caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: "Seth J. Fogarty" <sfogarty@students.uiuc.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] '_a out of nowhere? (list.reverse)
Date: Wed, 14 Apr 2004 21:22:31 +0200	[thread overview]
Message-ID: <131E0249-8E49-11D8-A972-000393DBC266@epfl.ch> (raw)
In-Reply-To: <20040414190532.GQ10439@students.uiuc.edu>

         Objective Caml version 3.07+2

# let cons x y = x::y
   and flip f x = f y x;;
Unbound value y
# let cons x y = x::y
   and flip f x y = f y x;;
val cons : 'a -> 'a list -> 'a list = <fun>
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c = <fun>
# let reverse = fun l -> List.fold_left (flip cons) [] l;;
val reverse : 'a list -> 'a list = <fun>
# reverse [1;2;3];;
- : int list = [3; 2; 1]
# reverse ['a';'b';'c'];;
- : char list = ['c'; 'b'; 'a']


It's a faq,

<http://caml.inria.fr/FAQ/FAQ_EXPERT- 
eng.html#variables_de_types_faibles>

Daniel

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-04-14 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 19:05 Seth J. Fogarty
2004-04-14 19:22 ` Daniel Bünzli [this message]
2004-04-14 19:37 ` Stephane Legrand

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=131E0249-8E49-11D8-A972-000393DBC266@epfl.ch \
    --to=daniel.buenzli@epfl.ch \
    --cc=caml-list@inria.fr \
    --cc=sfogarty@students.uiuc.edu \
    /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).