English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2002-07-28 (01:46)
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, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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