Version française
Home     About     Download     Resources     Contact us    
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:
>http://www.eleves.ens.fr:8080/home/frisch/soft#recursive
>
Thanks!  

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, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners