[Haskell-cafe] Re: monad subexpressions

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Sun Aug 5 02:11:03 EDT 2007


Bulat Ziganshin wrote:
> Hello apfelmus,
> 
> Saturday, August 4, 2007, 12:18:33 PM, you wrote:
> 
> > Then,  mytransaction  reads
> 
> >   mytransaction = return foo `apT` xvar0 `apT` xvar1 `apT` ...
> 
> how about a+b*(c+d)?

That follows the same pattern,

    return (+) `apT` a `apT`
        (return (*) `apT` b `apT` (return (+) `apT` c `apT` d))

Bertram


More information about the Haskell-Cafe mailing list