Hi again! Thanks for your help, Malcolm. I added `seq' at two places to prevent laziness and now I never run out of memory.
instance Monad M where return x = M $ \i -> (x,i) M f >>= k = M $ \i -> let (x,i2) = i `seq' f i M f2 = x `seq' k x in f2 i2 (however, I think that just one of the two `seq' should do but if I remove any single `seq' then I still run out of memory :( ) Kind regards Magnus _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell