[Haskell-cafe] Re: Stream processors
Peter Simons
simons at cryp.to
Thu Oct 21 12:12:28 EDT 2004
K P SCHUPKE writes:
> This is the interface I came up with (and its fairly efficient):
> data IList a i e = ICons i i (a i e) (IList a i e) | INil
Isn't that an interface for doing fast I/O rather than for
writing stream processors? If I look at the consumer:
> wc :: List l Word8 => l Word8 -> Char -> Int -> Int -> Int
> -> (Int,Int,Int)
I don't see how the IList data type would help writing the
wc function. Where is the advantage over
data CountingState = ST !Bool !Int !Int !Int
wc :: Char -> CountingState -> CountingState
...?
Peter
More information about the Haskell-Cafe
mailing list