[Haskell] Mixing monadic and non-monadic functions
Sergey Zaharchenko
doublef-ctm at yandex.ru
Fri Sep 16 08:02:49 EDT 2005
Hello Bulat!
Thu, Sep 15, 2005 at 09:19:41PM +0400 you wrote:
> Hello Ben,
>
> Wednesday, September 14, 2005, 6:32:27 PM, you wrote:
>
> BRG> do { ... ; ... borrow E ... ; ... }
>
> BRG> is transformed into
>
> BRG> do { ... ; x <- E ; ... x ... ; ... }
>
> 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') }
I might be misunderstanding, but aren't we going to introduce evaluation
order for `+' in this case?
--
DoubleF
No virus detected in this message. Ehrm, wait a minute...
/kernel: pid 56921 (antivirus), uid 32000: exited on signal 9
Oh yes, no virus:)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell/attachments/20050916/c6bd2073/attachment-0001.bin
More information about the Haskell
mailing list