
for a file main = print "hi" >> return undefined >> print "bye" ghc, hugs and nhc98 print "hi" "bye" yhc prints "hi" Prelude.undefined
That is strange. In my version of Yhc it works as expected (same as Hugs and GHC). The instance of IO for Monad in my version is: \begin{code} instance Monad IO where x >>= y = IO (primBind1 x y) where primBind1 (IO xf) y w = case xf w of Right xv -> case y xv of IO yv -> yv w Left err -> Left err -- Changing type x >> y = IO (primBind2 x y) where primBind2 (IO xf) y w = case xf w of Right xv -> case y of IO yv -> yv w Left err -> Left err -- Changing type return a = IO (primReturn a) where primReturn a w = Right a \end{code} To my eyes there is no strictness problem in this definition. Also, in my version IO is defined this way: \begin{code} data World = World newtype IO a = IO (World -> Either IOError a) \end{code}
From memory this is the same as it was in nhc98.
I haven't done a darcs pull for a week or so; perhaps my version is older than yours? Cheers, Bernie.

Hi
In my version of Yhc it works as expected (same as Hugs and GHC).
I haven't done a darcs pull for a week or so; perhaps my version is older than yours?
In the last week Tom has committed imprecise exceptions, so Yhc can now raise an error properly, which nhc can't. Tom also tweaked the >> and >>= instances and the definition of IO to remove the Either IOError case from the IO Monad. Obviously something has gone wrong, we'll look into it. Dons: I doubt this has anything to do with the slowdown on nobench, unless the regression has happened in the last week. Thanks Neil
participants (2)
-
Bernie Pope
-
Neil Mitchell