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: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] Recursive types
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>

> No need to memorize equivalences: s tuple expands at its head to s * s.
> The type checker guarantees that it is always safe to expand the head
> of a type (i.e., definitions are well-founded.)

Thanks for the reply.

> In order for unification to succeed above, t must expand to
> (< m: 'a * 'a> as 'a), and s too. But to print nicely types we must
> keep the abbreviations. This is done by memoizing expansions inside 
> the abbreviations themselves. 

This is a pretty nice feature of the type checker.
When programming with polymorphic variants,
the last part of typing error messages, 
which tells me incompatibilities of types using abbreviating names,
always helps me a lot.

With best regards,
Keiko