Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] equi-recursive Fold isomorphism
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] equi-recursive Fold isomorphism
Alain Frisch wrote:

>My Recursive module uses the same technique; it may do what you want:

Hmmm: Ocaml 3.04+15 with -rectypes

# let rec x = (1,(1,(1,x)));;
val x : int * (int * (int * 'a)) as 'a =

Seem like Ocaml doesn't minimise the type, but:

let rec y = (1,y);;

x = y;;

Works correctly (so it knows the two types are comparable).
Interestingly, the answer is false: both data structures 
consist of an infinite stream of 1's, represented by
cycles of distinct lengths. No item by item comparison
could reveal any distinction: the infinite tree expansions
of the data structures are the same. Is Ocaml's answer correct?

John Max Skaller,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: