[Haskell-beginners] Monadic fixed-point combinator.

Edward Z. Yang ezyang at MIT.EDU
Wed Aug 11 17:43:31 EDT 2010


Excerpts from Lyndon Maydwell's message of Wed Aug 11 17:33:14 -0400 2010:
> But would there be a way to add, say, execution tracing using an IO combinator?
> 
> > ioFix :: (a -> IO a) -> IO a
> > fix f = print "step" >> f (fix f)
> 
> I've had a play around with these functions, attempting to lift them
> into monadic actions, but I really have no idea how to approach this.

Hello Lyndon,

You're looking for monadic recursion, described in Levent Erkok's thesis.
Check out:

    http://www.haskell.org/haskellwiki/MonadFix
    http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.5313

Cheers,
Edward


More information about the Beginners mailing list