[Haskell-cafe] Re: monad subexpressions

Claus Reinke claus.reinke at talk21.com
Sat Aug 4 11:55:18 EDT 2007

>> so, there could be a library defining
>>     lhs ==: rhs = putMVar <$> lhs <*> rhs

ouch! since putMVar is already impure, there's a join missing:

    lhs ==: rhs = putMVar <$> lhs <*> rhs

>> and in your application code, you could write
>>   newEmptyMVar ==: putStrLn "hi there"

> .. rant deleted ..
> and use it. want to assign a=b/(c+d)? nothing can be easier! just
> define one more macro!

Dear Bulat

in your enthusiam, please do not forget to read what is written!

the lifted operations combine as the unlifted ones do. so there's
one definition each for =, /, +, not one definition for each of 
their combinations.


More information about the Haskell-Cafe mailing list