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] 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" <>
> 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,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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