Re: [Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Angel de Vicente
Hi, On 25/04/11 14:21, Stephen Tetley wrote: On 25 April 2011 14:11, Angel de Vicente wrote: curry :: ((a,b) -> c) -> (a -> b -> c) curry g x y = g (x,y) Is expressing curry this way more illuminating? curry :: ((a,b) -> c) -> (a -> b -> c) curry g = \x y -> g (x,y) That is, curr

Re: [Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Angel de Vicente
Hi, On 25/04/11 14:20, Ozgur Akgun wrote: On 25 April 2011 14:11, Angel de Vicente mailto:ang...@iac.es>> wrote: curry :: ((a,b) -> c) -> (a -> b -> c) is the same as: curry :: ((a,b) -> c) -> a -> b -> c thanks, it makes sense now. Somehow I thought that adding the parenthesis in ...

Re: [Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Benedict Eastaugh
On 25 April 2011 14:11, Angel de Vicente wrote: > OK, I have tried it and it works, but I don't understand the syntax for > curry. Until now I have encountered only functions that take the same number > of arguments as the function definition or less (partial application), but > this syntax looks

Re: [Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Stephen Tetley
On 25 April 2011 14:11, Angel de Vicente wrote: > curry :: ((a,b) -> c) -> (a -> b -> c) > curry g x y = g (x,y) Is expressing curry this way more illuminating? curry :: ((a,b) -> c) -> (a -> b -> c) curry g = \x y -> g (x,y) That is, curry is a function taking one argument that produces a res

Re: [Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Ozgur Akgun
On 25 April 2011 14:11, Angel de Vicente wrote: > curry :: ((a,b) -> c) -> (a -> b -> c) > is the same as: curry :: ((a,b) -> c) -> a -> b -> c HTH, Ozgur ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/

[Haskell-cafe] Trouble with currying and uncurrying...

2011-04-25 Thread Angel de Vicente
Hi, I'm reading "The Craft of Functional Programming" and I found something I don't understand in page 185. It says: "Suppose first that we want to write a curried version of a function g, which is itself uncurried and of type (a,b) -> c. curry g This funtion expects its arguments as a pa