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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi Vanicat <remi.vanicat@g...>
Subject: Re: [Caml-list] cyclic types
On Sat, 29 Jan 2005 14:15:43 +0200, Radu Grigore <radugrigore@gmail.com> wrote:
> Why are cyclic types forbidden?
> 
> I was forced to use the definition:
>   type forest = Forest of forest StringMap.t | Empty
> where I would have rather used
>   type forest = forest StringMap.t
> The error is:
>   The type abbreviation tree is cyclic

You can use the -rectypes of the ocaml compiler or toplevel to allow
cyclic type.