
18 May
2008
18 May
'08
5:53 p.m.
Philip Müller
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