caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Cyclic ?!
@ 2002-08-15  2:19 Oleg
  2002-08-15 14:31 ` Michael Hicks
  2002-08-18 16:13 ` [Caml-list] Cyclic ?! John Max Skaller
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg @ 2002-08-15  2:19 UTC (permalink / raw)
  To: caml-list

Hi

I'm puzzled by the following compiler behavior:

If I define bin_tree as

type 'a bin_tree = 
           Empty
         | Node of 'a bin_tree * 'a * 'a bin_tree

the compiler accepts it. OTOH if I define it as

type 'a bin_tree = ('a bin_tree * 'a * 'a bin_tree) option

It gives an error: "The type abbreviation bin_tree is cyclic".
Why??? And what's the difference between the two, really?

Thanks
Oleg
-------------------
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] 7+ messages in thread

end of thread, other threads:[~2002-09-25  7:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-15  2:19 [Caml-list] Cyclic ?! Oleg
2002-08-15 14:31 ` Michael Hicks
2002-08-15 17:26   ` Oleg
2002-08-15 18:05     ` Markus Mottl
2002-08-15 18:16       ` Brian Smith
2002-09-24 16:23     ` [Caml-list] Recursive types (Was Cyclic ?!) Christophe Raffalli
2002-08-18 16:13 ` [Caml-list] Cyclic ?! John Max Skaller

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