[Haskell-cafe] Cute code

Andrew Coppin andrewcoppin at btinternet.com
Tue May 29 16:52:36 EDT 2007


Donald Bruce Stewart wrote:
> I use it when I need a local loop expression, maybe once every couple of
> months. A real world example from xmonad,
>
>  f = fix $ \again -> do
>             more <- checkMaskEvent d enterWindowMask ev
>             when more again 
>
> That is, keep sucking up X events till there's no 'more'.
>   

My God... that's almost as cute as the first thing!



More information about the Haskell-Cafe mailing list