<p dir="ltr">If you're looking to do this without returns, you should take a look at the RebindableSyntax  extension.</p>
<p dir="ltr">[1]: <a href="https://ocharles.org.uk/blog/guest-posts/2014-12-06-rebindable-syntax.html">https://ocharles.org.uk/blog/guest-posts/2014-12-06-rebindable-syntax.html</a></p>
<br><div class="gmail_quote"><div dir="ltr">On Sun 12 Jun, 2016, 11:17 AM Christopher Howard, <<a href="mailto:ch.howard@zoho.com">ch.howard@zoho.com</a>> wrote:<br></div><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" target="_blank">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><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><p dir="ltr">Regards,<br>
  Sumit</p>
</div>