Version française
Home     About     Download     Resources     Contact us    
Browse thread
typing problem with sexplib and mutually recursive polymorphic types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: yoann padioleau <padator@w...>
Subject: Re: [Caml-list] typing problem with sexplib and mutually recursive polymorphic types
> 
> This has to do with recursive type definitions, not with generating
> closures with _loc. The following is similar and does not compile
> either:
> 
> let rec foo () = []
> and bar () = "asdf" :: foo ()
> and bla () = 42 :: foo ()
> 
> These definitions are clearly sound, but the type checker doesn't get
> it. Note, however, that the following works:
> 
> let foo () = []
> let rec bar () = "asdf" :: foo ()
> and bla () = 42 :: foo ()
> 
> You can apply the same trick in your specific example by simply moving
> the type definition of x1 out of the cycle with x2 and x3.

Yes on this example, but what if I can't move it out because
the types really need to be mutually recursive ?


> 
> Cheers,
> Markus
> 
> -- 
> Markus Mottl http://www.ocaml.info markus.mottl@gmail.com
> 
>