[Haskell] Mixing monadic and non-monadic functions

Bulat Ziganshin bulatz at HotPOP.com
Fri Sep 16 09:08:18 EDT 2005

Hello Sergey,

Friday, September 16, 2005, 4:02:49 PM, you wrote:

>>    z := *x + *y   -- translated to { x' <- readIORef x; y' <- readIORef y; writeIORef z (x'+y') }

SZ> I might be misunderstanding, but aren't we going to introduce evaluation
SZ> order for `+' in this case?

of course. really, in many situations evaluation order is just not
matter, including all IORef usage i could imagine

btw, if someone interested, explicit operation for dereferencing
variables used in ML (afair, it called just "."), and in some old
system programming language, may be BLISS

of course, automatic dereferncing could be much better, but it rises
some potential double-readings just like auto-lifting (f.e., "z:=x" -
is z must have type "IORef a" or "IORef (IORef a)", if x have type
"IORef a" ? )

Best regards,
 Bulat                            mailto:bulatz at HotPOP.com

More information about the Haskell mailing list