Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/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:  Monads of functions (Szymon Pajzert)


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

Message: 1
Date: Sun, 7 May 2017 12:44:46 +0200
From: Szymon Pajzert <szymonpajz...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Monads of functions
Message-ID:
        <CAFux-B8pL9W=+PTcmj3ucbowssdVUMyj8o=zlvuaahlrpvj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Colleague has helped me with the solution for the Reader, without general
solution (probably it's not possible to do so for every monad):

foo :: (a -> Reader r b) -> Reader r (a -> b)
foo f = do
    r <- ask
    return $ \a -> runReader (f a) r

Hope that's gonna help someone in the future.

On 6 May 2017 at 11:08, Szymon Pajzert <szymonpajz...@gmail.com> wrote:

> Hello,
>
> Lately I'm working with Reader monad. Because of that, I have to use
> function of signature:
>
> Monad m => (a -> m b) -> m (a -> b).
>
> Is this even possible to do so? Thanks in advance for your help.
>
> Best Regards,
> Szymon Pajzert
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20170507/ce020058/attachment-0001.html>

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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 107, Issue 6
*****************************************

Reply via email to