Re: [Haskell-cafe] Re: help with Haskell programming

2010-04-19 Thread Jason Dagit
On Sun, Apr 18, 2010 at 10:25 AM, Sean Leather leat...@cs.uu.nl wrote: This is the annoying part about Haskell . I can not understand composition . One of the ways of understanding composition (and many other functions in Haskell) is by trying to understand its type. Here it is shown by

Re: [Haskell-cafe] Re: help with Haskell programming

2010-04-18 Thread Keith Sheppard
Using composition can be tricky with more than one arg. I just want to be sure you're not really looking for something like: func :: (a - Bool) - (b - Bool) - (a - b - Bool) keeping with your given type I think you're looking for something like: func f1 f2 x = (f1 x) || (f2 x) I'm sure there

Re: [Haskell-cafe] Re: help with Haskell programming

2010-04-18 Thread Sean Leather
This is the annoying part about Haskell . I can not understand composition . One of the ways of understanding composition (and many other functions in Haskell) is by trying to understand its type. Here it is shown by looking at the type in the interpreter GHCi. *Main :t (.) (.) :: (b - c) -

Re: [Haskell-cafe] Re: help with Haskell programming

2010-04-18 Thread Thomas Davie
To do this, you need not just fmap (composition), but also ap, or the combined form, liftA2: func = liftA2 (||) Bob On 18 Apr 2010, at 18:21, Keith Sheppard wrote: Using composition can be tricky with more than one arg. I just want to be sure you're not really looking for something like:

Re: [Haskell-cafe] Re: help with Haskell programming

2010-04-18 Thread Mujtaba Boori
Thanks a lot guys you were really helpful func f1 f2 x = (f1 x) || (f2 x) is working for me On Sun, Apr 18, 2010 at 6:27 PM, Thomas Davie tom.da...@gmail.com wrote: To do this, you need not just fmap (composition), but also ap, or the combined form, liftA2: func = liftA2 (||) Bob On