
5 Mar
2009
5 Mar
'09
8:27 p.m.
Quoth Jonathan Cast
You can certainly use let:
reader <- forkIO $ let loop = do (nr', line) <- readChan chan' when (nr /= nr') $ hPutStrLn hdl line loop in loop
But the version with fix is clearer (at least to people who have fix in their vocabulary) and arguably better style.
Would you mind presenting the better style argument? To me, the above could not be clearer, so it seems like the version with fix could be only as clear, at best. Thanks, Donn cave PS - granted that "forever" is a fine alternative to either, I suppose it doesn't affect the style comparison above.