From: "Seth J. Fogarty" <sfogarty@students.uiuc.edu>
To: caml-list@inria.fr
Subject: [Caml-list] '_a out of nowhere? (list.reverse)
Date: Wed, 14 Apr 2004 14:05:32 -0500 [thread overview]
Message-ID: <20040414190532.GQ10439@students.uiuc.edu> (raw)
# 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 = List.fold_left (flip cons) [];;
val reverse : '_a list -> '_a list = <fun>
# reverse [1;2;3];;
- : int list = [3; 2; 1]
# reverse ['a';'b';'c'];;
This expression has type char but is here used with type int
I've encountered similar things with references, but never with something as
basic as a fold_left. Can someone tell me why this is happening? This, to me,
is very wrong behavior. This is on Debian's OCaml 3.07.
--
Arav bipsum
Aim: Sorrath ICQ: 47462500
The same person. No difference at all. Just a different sex. -Orlando
(Orlando, 1992)
-------------------
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
next reply other threads:[~2004-04-14 19:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-14 19:05 Seth J. Fogarty [this message]
2004-04-14 19:22 ` Daniel Bünzli
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=20040414190532.GQ10439@students.uiuc.edu \
--to=sfogarty@students.uiuc.edu \
--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