[Haskell-cafe] 'Progress bar' enumeratee

Ertugrul Soeylemez es at ertes.de
Wed Apr 6 18:38:06 CEST 2011


As a side note, even though GHC seems to handle this properly, I would
force the value of 'i' before passing data to the continuation.
Otherwise a less smart compiler may eat memory.  I believe, it can only
eat memory proportional to 'n', but nevertheless real constant space is
better:

    seq i $ k ch >>== (\step -> printDots >> loop i step)


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





More information about the Haskell-Cafe mailing list