[Haskell-cafe] left to right pipeline of functions

David Feuer david.feuer at gmail.com
Sun Jun 12 06:40:49 UTC 2016


I suspect you're looking for something simpler: >>> from Control.Category,
which just composes things in reverse. Another nice function is >=> from
Control.Monad.
On Jun 12, 2016 1:47 AM, "Christopher Howard" <ch.howard at zoho.com> wrote:

> Hi, I am learning about monads, and this question came to mind: is there
> a way to have a sequence of functions left to right like so:
>
> g = return 2 >>= \n -> return (n + 1) >>= \n -> return (n + 3)
>
> Either: some kind of generic monad that makes this legal, or some way to
> do this without monad (i.e., without the "returns").
>
> --
> http://justonemoremathproblem.com
> To protect my privacy, please use PGP encryption. It's free and easy
> to use! My public key ID is 0x340EA95A (pgp.mit.edu).
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160612/fbbcfb8d/attachment.html>


More information about the Haskell-Cafe mailing list