Re: Re: [Haskell-cafe] Cannot understand liftM2

2006-12-11 Thread Nicola Paolucci
Hi Nicolas, On 12/11/06, Nicolas Frisby <[EMAIL PROTECTED]> wrote: The interpreter infers that m = (e ->) because of the types of snd and fst. When snd and fst are considered as monadic computations in the (e ->) monad, there types are: Prelude> :t fst fst :: (a, b) -> a Prelude> :t snd snd ::

Re: [Haskell-cafe] Cannot understand liftM2

2006-12-11 Thread Nicola Paolucci
Hi All, Hi Cale, Can you tell me if I understood things right ? Please see below ... On 12/11/06, Cale Gibbard <[EMAIL PROTECTED]> wrote: The monad instance which is being used here is the instance for ((->) e) -- that is, functions from a fixed type e form a monad. So in this case: liftM2 ::

Re: [Haskell-cafe] Cannot understand liftM2

2006-12-11 Thread Nicola Paolucci
Hi Cale ! On 12/11/06, Cale Gibbard <[EMAIL PROTECTED]> wrote: The monad instance which is being used here is the instance for ((->) e) -- that is, functions from a fixed type e form a monad. So in this case: liftM2 :: (a1 -> a2 -> r) -> (e -> a1) -> (e -> a2) -> (e -> r) I bet you can guess wh

[Haskell-cafe] Cannot understand liftM2

2006-12-11 Thread Nicola Paolucci
Hi All, I'm loving learning Haskell quite a bit. It is stretching my brain but in a delightfull way. I've googled, I've hoogled but I haven't found a clear explanation for what exactly liftM2 does in the context below. Using the cool lambdabot "pointless" utility I found out that: \x -> snd(x

Re: [Haskell-cafe] Command line utility that shrinks/simplifies functions applications ?

2006-11-30 Thread Nicola Paolucci
Hi Spencer, On 11/30/06, Spencer Janssen <[EMAIL PROTECTED]> wrote: I believe you're talking about the `pl' plugin for lambdabot. Lambdabot has an offline mode, visit the homepage for the source: http://www.cse.unsw.edu.au/~dons/lambdabot.html That's exactly what I was looking for! Tha

[Haskell-cafe] Command line utility that shrinks/simplifies functions applications ?

2006-11-30 Thread Nicola Paolucci
Hi All! Haskell newbie here with a very simple question because google and hoogle are of no help. On the IRC channel #haskell (which I cannot access now from work) I saw somebody using a tool which automatically simplifies expressions,composition of multiple functions to the bare minimum. It was