Re: [Haskell] generic currying (type classes and functional dependencies)

2004-05-13 Thread Ronny Wichers Schreur
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

[Haskell] generic currying (type classes and functional dependencies)

2004-05-11 Thread Duncan Coutts
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

Re: [Haskell] generic currying (type classes and functional dependencies)

2004-05-11 Thread Malcolm Wallace
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

Re: [Haskell] generic currying (type classes and functional dependencies)

2004-05-11 Thread Esa Pulkkinen
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,