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: Jacques Carette <carette@m...>
Subject: RE: [Caml-list] Single-case union types as strong typedefs
> Once again, consider this:
> 
>    type foo = Constr of foo;;
>    let rec x = Constr x;;
> 
> If you eliminate the constructor, there's nothing left!
> 
> -- Damien

Isn't that correct though?  The value x is completely known statically, and
all computation on x can be done statically, so it is not necessary to have
any traces of x left at run-time.

Yes, I am assuming that a fair bit of partial evaluation is a good thing for
the compiler to do.

Jacques