On Fri, Nov 13, 2009 at 2:04 AM, Bryan O'Sullivan <b...@serpentine.com> wrote:
>
> 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 <d...@zednenem.com>
<http://www.eyrie.org/~zednenem/>
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to