caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean Saint-Remy <jeansaintremy@yahoo.com>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] applying labled argument error
Date: Fri, 8 Nov 2013 19:33:35 -0800 (PST)	[thread overview]
Message-ID: <1383968015.11272.YahooMailNeo@web160505.mail.bf1.yahoo.com> (raw)

[-- 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 --]

             reply	other threads:[~2013-11-09  3:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-09  3:33 Jean Saint-Remy [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383968015.11272.YahooMailNeo@web160505.mail.bf1.yahoo.com \
    --to=jeansaintremy@yahoo.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).