Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Single-case union types as strong typedefs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Single-case union types as strong typedefs
On Oct 23, 2004, at 03:49, Nathaniel Gray wrote:

>   type x = Foo y
>      --> type x = y  (* Only necessary if types are retained after
> type checking *)
>   Foo x
>      --> x
>   match x with Foo y -> expr
>      --> let y = x in expr

Once again, consider this:

   type foo = Constr of foo;;
   let rec x = Constr x;;

If you eliminate the constructor, there's nothing left!

-- Damien

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