
17 Mar
2010
17 Mar
'10
7:17 p.m.
As a general style tip, since you're using language extensions anyway
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
you might want to add "BangPatterns", so you can put the strictness annotation directly on the argument. Either by doing this: go !n = ... or later on: let !n' = ... return I.Cont ...
cnt = go 0 where go n = I.IterateeG $ \ch -> case ch of (I.EOF Nothing) -> return $ I.Done n ch (I.EOF (Just e)) -> return $ I.Cont cnt (Just e) (I.Chunk (I.WrapBS s)) -> do let n' = n + S.count '\n' s return $ n' `seq` I.Cont (go n') Nothing