Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] First order compile time functorial polymorphism in Ocaml
[ 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] First order compile time functorial polymorphism in Ocaml
Jacques Garrigue wrote:

> From: "Jacques Carette" <carette@mcmaster.ca>
 
> But honestly, if you have no particular need to cut your type in small
> pieces (you need it for incremental extension for instance), you're
> better off with sum types, and the safe approach I presented in my
> previous mail.

That was very cute! I'm implementing it now.
WITH polymorphic variants. WITH cutting up the types.
Even supports covariance via parameterisation trick.
Seems to work so far. I do use exact types though.

I expect the open recursion technique will actually
solve an outstanding problem. I have a two functions,
fold and unfold which operate on type representations.
Unfold is fine: its the identity unless the fixpoint
binder is the top term.

Fold doesn't work properly: it will undo a fold,
but it doesn't do what I really need: to minimise
the representation of a type be recursively
folding every node.

You just showed me how to fix that (in principle
at least): its very cute to modify a function that
works on the top level only, into one rebuilds the tree
bottom up.

-- 
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