Version française
Home     About     Download     Resources     Contact us    
Browse thread
recursive types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] recursive types
On Mon, 2004-12-13 at 20:58, Damien Pous wrote:
> You can do something this:
> 
> type 'a exp_ = [`Num of 'a |`Neg of 'a] 
> 
> class type obj = object 
>   method eql : obj exp_ ->  bool
> end
> 
> type exp = obj exp_

Or the converse (parameterise the class instead).

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net