Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Maybe monad and computations (Daniel Trstenjak)
   2. Re:  Maybe monad and computations (Emmanuel Touzery)
   3. Re:  Maybe monad and computations (Daniel Trstenjak)


----------------------------------------------------------------------

Message: 1
Date: Sat, 7 Sep 2013 09:49:16 +0200
From: Daniel Trstenjak <daniel.trsten...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of
        primarilybeginner-level topics related to Haskell
        <beginners@haskell.org>
Cc: The Haskell-Beginners Mailing List - Discussion of
        primarilybeginner-level topics related to Haskell
        <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Maybe monad and computations
Message-ID: <07edb9e0-b233-42b4-8dac-e77fea745...@gmail.com>
Content-Type: text/plain;       charset=us-ascii

> I thought I understood it, but looking at the difference in behaviour in the 
> examples I posted, maybe I don't.

I would try to add a type signature for liftM2, perhaps you're than getting a 
more helpful error message.

Greetings,
Daniel


------------------------------

Message: 2
Date: Sat, 7 Sep 2013 10:01:14 +0200
From: Emmanuel Touzery <etouz...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Maybe monad and computations
Message-ID:
        <CAC42Reni0ENzM-Y9Muy3=30MXLPv46+a+FRgJS=ar1dmzav...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I got an helpful answer on stackoverflow that probably explains it all.
Otherwise if i add the type, i'll have to bind it to a concrete monad due
to the lack of typeclasses, that's why i didn't put a type. Thanks again.
On Sep 7, 2013 9:50 AM, "Daniel Trstenjak" <daniel.trsten...@gmail.com>
wrote:

> > I thought I understood it, but looking at the difference in behaviour in
> the examples I posted, maybe I don't.
>
> I would try to add a type signature for liftM2, perhaps you're than
> getting a more helpful error message.
>
> Greetings,
> Daniel
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130907/e2e804fb/attachment-0001.html>

------------------------------

Message: 3
Date: Sat, 7 Sep 2013 10:28:38 +0200
From: Daniel Trstenjak <daniel.trsten...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of
        primarilybeginner-level topics related to Haskell
        <beginners@haskell.org>
Cc: The Haskell-Beginners Mailing List - Discussion of
        primarilybeginner-level topics related to Haskell
        <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Maybe monad and computations
Message-ID: <e149bac8-2e67-4d9f-b209-d901c1d77...@gmail.com>
Content-Type: text/plain; charset="us-ascii"



Am 07.09.2013 um 10:01 schrieb Emmanuel Touzery <etouz...@gmail.com>:

> I got an helpful answer on stackoverflow that probably explains it all. 
> Otherwise if i add the type, i'll have to bind it to a concrete monad due to 
> the lack of typeclasses, that's why i didn't put a type. Thanks again.
> 
Ok, that explains a lot.

But if you need this kind of operation a lot, you could still have something 
like:

liftMaybe2 :: (a -> b -> c) -> Maybe a -> Maybe b ->  Maybe c
liftMaybe2 f (Just a) (Just b) = Just $ f a b
liftMaybe2 _ _ _                    = Nothing


Greetings,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130907/7ea82956/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 63, Issue 12
*****************************************

Reply via email to