<p dir="ltr">I suspect you're looking for something simpler: >>> from Control.Category, which just composes things in reverse. Another nice function is >=> from Control.Monad.</p>
<div class="gmail_quote">On Jun 12, 2016 1:47 AM, "Christopher Howard" <<a href="mailto:ch.howard@zoho.com">ch.howard@zoho.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I am learning about monads, and this question came to mind: is there<br>
a way to have a sequence of functions left to right like so:<br>
<br>
g = return 2 >>= \n -> return (n + 1) >>= \n -> return (n + 3)<br>
<br>
Either: some kind of generic monad that makes this legal, or some way to<br>
do this without monad (i.e., without the "returns").<br>
<br>
--<br>
<a href="http://justonemoremathproblem.com" rel="noreferrer" target="_blank">http://justonemoremathproblem.com</a><br>
To protect my privacy, please use PGP encryption. It's free and easy<br>
to use! My public key ID is 0x340EA95A (<a href="http://pgp.mit.edu" rel="noreferrer" target="_blank">pgp.mit.edu</a>).<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>