Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-07 Thread Victor Nazarov
On Wed, May 6, 2009 at 7:44 PM, Daniel Peebles wrote: > Keep in mind that using lists for your parameters means you lose > static guarantees that you've passed the correct number of arguments > to a function (so you could crash at runtime if you pass too few or > too many parameters to a function

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Daniel Peebles
Keep in mind that using lists for your parameters means you lose static guarantees that you've passed the correct number of arguments to a function (so you could crash at runtime if you pass too few or too many parameters to a function). On Wed, May 6, 2009 at 11:41 AM, Nico Rolle wrote: > super

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Nico Rolle
super nice. best solution for me so far. big thanks. regards 2009/5/6 Victor Nazarov : > On Tue, May 5, 2009 at 8:49 PM, Nico Rolle wrote: >> >> Hi everyone. >> >> I have a problem. >> A function is recieving a lambda expression like this: >> (\ x y -> x > y) >> or like this >> (\ x y z a -> (x >

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Daniel Peebles
isn't doLam just id with an Ord restriction there? On Wed, May 6, 2009 at 5:55 AM, Victor Nazarov wrote: > On Tue, May 5, 2009 at 8:49 PM, Nico Rolle wrote: >> >> Hi everyone. >> >> I have a problem. >> A function is recieving a lambda expression like this: >> (\ x y -> x > y) >> or like this >>

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Victor Nazarov
On Tue, May 5, 2009 at 8:49 PM, Nico Rolle wrote: > Hi everyone. > > I have a problem. > A function is recieving a lambda expression like this: > (\ x y -> x > y) > or like this > (\ x y z a -> (x > y) && (z < a) > > my problem is now i know i have a list filled with the parameters for > the lamb

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Richard O'Keefe
On 6 May 2009, at 4:49 am, Nico Rolle wrote: Hi everyone. I have a problem. A function is recieving a lambda expression like this: (\ x y -> x > y) or like this (\ x y z a -> (x > y) && (z < a) Your first function has type Ord a => a -> a -> Bool so your list of parameters must have

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Ketil Malde
Nico Rolle writes: > A function is recieving a lambda expression like this: > (\ x y -> x > y) > or like this > (\ x y z a -> (x > y) && (z < a) And the type of that function is..? > my problem is now i know i have a list filled with the parameters for > the lambda expression. but how can i c

Re: FW: Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Ryan Ingram
eral way. But unless you are just using it for syntactic sugar (which seems unlikely for this use case), it's usually a signal that you are doing something wrong. -- ryan >>> Von: Ryan Ingram >>> Gesendet: 05.05.09 18:58:32 >>> An: Nico Rolle >>> CC

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Ryan Ingram
This is a Hard Problem in Haskell. Let me ask you, how many parameters does this function take? a = (\x -> x) How many parameters does this function take? b = (\f x -> f x) How many parameters does this function take? c = (\f x y -> f x y) What if I call a (+)? -- ryan On Tue, May 5, 2009 a

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Miguel Mitrofanov
Short answer: that's impossible. Well, with some oleging it should be possible, but the very fact that you're trying to do something like this indicates that you're doing something wrong. Where did this list of parameters came from? May be, you can apply your function to them one at a time,

[Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Nico Rolle
Hi everyone. I have a problem. A function is recieving a lambda expression like this: (\ x y -> x > y) or like this (\ x y z a -> (x > y) && (z < a) my problem is now i know i have a list filled with the parameters for the lambda expression. but how can i call that expression? [parameters] is my