caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] applying labled argument error
@ 2013-11-09  3:33 Jean Saint-Remy
  2013-11-09  4:27 ` Eric Cooper
  2013-11-09 10:07 ` Gabriel Kerneis
  0 siblings, 2 replies; 6+ messages in thread
From: Jean Saint-Remy @ 2013-11-09  3:33 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

Hi,

I am running ocaml 3.12.1 and getting an error message. Is it an incompatible version error or a missing 'core' module?

let permute array = 

  let length = Array.length array in
  for i=0 to length - 2 do
  let j = i + 1 + Random.int (length - i - 1) in 

  let tmp = array.(i) in 

  array.(i) <- array.(j);
  array.(j) <- tmp
  done ;;
let ar = Array.init 20 ~f:(fun i -> i) ;;
-: "Error: The function applied to this argument has type (int -> 'a) -> 'a array
     This argument cannot be applied with label ~f."

Best regards,

Jean

[-- Attachment #2: Type: text/html, Size: 1012 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-09 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-09  3:33 [Caml-list] applying labled argument error Jean Saint-Remy
2013-11-09  4:27 ` Eric Cooper
2013-11-09 10:07 ` Gabriel Kerneis
2013-11-09 17:57   ` Jean Saint-Remy
2013-11-09 18:39     ` Anthony Tavener
2013-11-09 18:42     ` Anil Madhavapeddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).