Duncan Coutts writes (to the Haskell Mailing list):
I'm trying to write a generic curry ( uncurry) function that works for
functions of any arity.
See http://www.haskell.org/pipermail/haskell/2003-April/011720.html
where oleg presents a (ghc-specific) solution.
Cheers,
Ronny Wichers Schreur
Hi All,
I'm trying to write a generic curry ( uncurry) function that works for
functions of any arity. I have a couple solutions that nearly work, both
involving type classes.
Here's the first one:
class Curry tupled curried where
genericCurry :: tupled - curried
genericUncurry :: curried
Duncan Coutts [EMAIL PROTECTED] writes:
So I thought that functional dependencies might help because the curried
type should uniquely determine the uncurried type (and vice versa).
However if I change the class declaration to:
class Curry tupled curried | tupled - curried, curried - tupled
In message [EMAIL PROTECTED], Duncan Coutts writes:
I'm trying to write a generic curry ( uncurry) function that works for
functions of any arity. I have a couple solutions that nearly work, both
involving type classes.
[SNIP]
Any insight or suggestions would be interesting.
Here's one solution,