
13 Nov
2009
13 Nov
'09
12:55 p.m.
On Fri, Nov 13, 2009 at 2:04 AM, Bryan O'Sullivan
And the lengthI function is defined more generally, in the hope that I could use it for both Int and Int64 lengths:
lengthI :: Integral a => Stream Char -> a lengthI (Stream next s0 _len) = loop_length 0 s0 where loop_length !z s = case next s of Done -> z Skip s' -> loop_length z s' Yield _ s' -> loop_length (z + 1) s' {-# INLINE[0] lengthI #-}
Would it help to SPECIALIZE lengthI for Int and Int64?
--
Dave Menendez