caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] '_a out of nowhere? (list.reverse)
@ 2004-04-14 19:05 Seth J. Fogarty
  2004-04-14 19:22 ` Daniel Bünzli
  2004-04-14 19:37 ` Stephane Legrand
  0 siblings, 2 replies; 3+ messages in thread
From: Seth J. Fogarty @ 2004-04-14 19:05 UTC (permalink / raw)
  To: caml-list

# 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


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

end of thread, other threads:[~2004-04-14 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 19:05 [Caml-list] '_a out of nowhere? (list.reverse) Seth J. Fogarty
2004-04-14 19:22 ` Daniel Bünzli
2004-04-14 19:37 ` Stephane Legrand

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).