Philip Müller <[EMAIL PROTECTED]> writes:

> import qualified Data.ByteString as B
> import qualified Data.ByteString.Char8 as C8

Note that these use the same underlying data structure, but Char8
interprets the contents as Char instead of Word8.  So the B.heads and
B.break should be CS8 - for consistency's sake, you could replace them
all and drop the "B" import.

>                   readField xs | xs == B.empty    = ([],[])
>                                | B.head xs == ',' = ([], B.tail xs)
>                                | B.head xs == '"' = (field, B.tail rest)
>                                     where
>                                        field,rest) = B.break (== '"') xs

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to