
30 Jul
2008
30 Jul
'08
1:38 a.m.
On Wed, Jul 30, 2008 at 4:18 AM, Wei Hu
Thanks for pointing out the sharing part. My original question is still unanswered: for lazy monads, can we give such a general mfix definition?
I dunno. I played around with your definition and the mfix laws, and was unable to get anywhere. * mfix (return . h) = return (fix h) * mfix (\x -> a >>= \y -> f x y) = \y -> mfix (\x -> f x y) * if h is strict, mfix (liftM h . f) = liftM h (mfix (f . h)) * mfix (\x -> mfix (\y -> f x y)) = mfix (\x -> f x x) But I think this is the way to approach it. There are many kinds of "lazy monads", so presumably an exploration of this form will help characterize the kinds of monads for which this definition does work. Luke