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
Polymorphic recursion, please
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-09-20 (11:49)
From: Lukasz Stafiniak <lukstafi@g...>
Subject: Polymorphic recursion, please

I've been beaten by lack of polymorphic recursion again. I propose the
following syntax:

let rec (f :> ty) = ...

Here, all type variables (explicit and implicit) in ty are
generalized. The alternative syntax:

let rec (f : 'a b c . ty) = ...

makes it more difficult (if possible? I forgot.) to catch implicit row
variables (I'm using polymorphic variants for subtyping).