Version française
Home     About     Download     Resources     Contact us    
Browse thread
parameterized pattern
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] parameterized pattern
On Thu, 2006-11-09 at 08:22 -0800, brogoff wrote:
> On Thu, 9 Nov 2006, skaller wrote:
[]
> > So it now has first order typeclasses to solve this problem.
> 
> Did you consider GCaml style generic functions?

Yes, but they seem a bit harder to implement.
The closure is nice though. The example has a type like:

{ 'a -> 'a -> 'a < [| int -> int -> int
| float -> float -> float |] }

but I don't know how to unify alternatives.

Feels a bit like a GLR parser .. you fork the unification
with each case, drop a thread when unification fails,
and merge successes into alternatives?

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net