harald.rotter:
> 
> Hi,
> 
> I read about the usage of "fix" to define recursive functions. Although I
> think that I understood how to use "fix", I still wonder what the
> advantages of "fix" are (as compared to the "conventional" approach to
> define recursive functions).
> 
> Any hints are appreciated.
> 

There's no obvious advantage that I know of, other than being cute.
An example from xmonad:

    allocaXEvent $ \p -> fix $ \again -> do
        more <- checkMaskEvent d enterWindowMask p
        when more again

So actually, I suppose it is useful for small, anonymous recursive definitions.

-- Don
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to