
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 for a file main = print "hi" >> return undefined >> print "bye" ghc, hugs and nhc98 print "hi" "bye" yhc prints "hi" Prelude.undefined In other words, IO's (>>=) and (>>) (defined in src/packages/yhc-base-1.0/Prelude.hs) are too strict. (at least I assume that behavior is considered wrong...) I can't see a simple way to fix it, given Yhc's representation of IO (no other compiler, not even nhc98, uses newtype IO a = IO (World -> a)), but maybe someone else does. Maybe an artificial "dependingOn", like seq but that doesn't even evaluate its argument to WHNF, is needed? (inspired by jhc's primitive dependingOn :: a -> b -> a, which is the OPPOSITE argument order (like const, rather than seq) and I'm not sure if it has the semantics I'm suggesting, but, whatever...) Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF8+T6HgcxvIWYTTURAlDyAJ4omDQnum4klKb+tD+p3PMFwRwZawCfZLjV vBZPV5y9j/uVI0Lf58nxKBA= =H9Lt -----END PGP SIGNATURE-----

isaacdupree:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
for a file main = print "hi" >> return undefined >> print "bye" ghc, hugs and nhc98 print "hi" "bye" yhc prints "hi" Prelude.undefined
In other words, IO's (>>=) and (>>) (defined in src/packages/yhc-base-1.0/Prelude.hs) are too strict. (at least I assume that behavior is considered wrong...)
I can't see a simple way to fix it, given Yhc's representation of IO (no other compiler, not even nhc98, uses newtype IO a = IO (World -> a)), but maybe someone else does. Maybe an artificial "dependingOn", like seq but that doesn't even evaluate its argument to WHNF, is needed? (inspired by jhc's primitive dependingOn :: a -> b -> a, which is the OPPOSITE argument order (like const, rather than seq) and I'm not sure if it has the semantics I'm suggesting, but, whatever...)
I wonder if this explains the weird too-much-work done bug in the calendar benchmark: http://www.cse.unsw.edu.au/~dons/code/nobench/spectral/calendar where: nhc98 yhc 0.04 (0.0) 97.24 (26.8) (also listed on the bug tracker). Something wrong in the monad immplementation anyway. -- don
participants (2)
-
dons@cse.unsw.edu.au
-
Isaac Dupree