
19 Jan
2010
19 Jan
'10
5:50 a.m.
Antoine Latter wrote:
getResponse = do require 256 x <- getX len <- getWord16be y <- getY z <- getZ require (fromIntegral len * 8) a <- getA b <- getB return $ Response x y z a b c
This looks like code that could be written in applicative style, in which case you could analyze the parser and automatically compute how many bytes are needed, removing the need for explicit calls to require. Groetjes, Martijn.