
26 Dec
2007
26 Dec
'07
6:42 a.m.
On Dec 23, 2007 1:44 PM, Isaac Dupree
parseHeader3 :: BS.ByteString -> Maybe (Int, Int) parseHeader3 bs = do (x, rest) <- BS.readInt $ BS.dropWhile (not . isDigit) bs (y, _) <- BS.readInt $ BS.dropWhile (not . isDigit) rest return (x, y)
But that version still itches! :-) This is what it sounds like to me: parseHeader :: BS.ByteString -> Maybe (Int,Int) parseHeader = evalStateT $ liftM2 (,) parseInt parseInt where parseInt = StateT $ BS.readInt . BS.dropWhile (not . isDigit) - Benja