[Haskell] Mixing monadic and non-monadic functions

Udo Stenzel u.stenzel at web.de
Fri Sep 16 11:19:49 EDT 2005


Bulat Ziganshin wrote:
> i strongly support this suggestion. actually, i suggest the same for
> dealing with references (IORef/MVar/...), for example:
> 
> do x <- newIORef 0
>    y <- newIORef 0
>    z <- newIORef 0
>    z := *x + *y   -- translated to { x' <- readIORef x; y' <- readIORef y; writeIORef z (x'+y') }

May I humbly suggest you explain what problem you are actually trying to
solve here?  I've never felt the need to hide monadic binding behind
fancy syntax, defining some combinator was always sufficient.  I mean...
if you want C, you know where to find it.  If possible I'd rather not
see the same programming "style" in Haskell.


Udo.
-- 
<Marticus> There's too much blood in my caffeine system.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell/attachments/20050916/156f36c9/attachment.bin


More information about the Haskell mailing list