<div dir="ltr">Colleague has helped me with the solution for the Reader, without general solution (probably it's not possible to do so for every monad):<div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>foo :: (a -> Reader r b) -> Reader r (a -> b)</div></div><div><div>foo f = do</div></div><div><div> r <- ask</div></div><div><div> return $ \a -> runReader (f a) r</div></div><div><br></div></blockquote>Hope that's gonna help someone in the future.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 May 2017 at 11:08, Szymon Pajzert <span dir="ltr"><<a href="mailto:szymonpajzert@gmail.com" target="_blank">szymonpajzert@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Lately I'm working with Reader monad. Because of that, I have to use function of signature:</div><div><br></div><div>Monad m => (a -> m b) -> m (a -> b).</div><div><br></div><div>Is this even possible to do so? Thanks in advance for your help.</div><div><br></div><div>Best Regards,</div><div>Szymon Pajzert</div></div>
</blockquote></div><br></div>