
27 Apr
2011
27 Apr
'11
3:52 p.m.
John Meacham's DrIFT tool used to get extended faster than GHC for things that "should" be automatic. I'm not sure of its current status, though: http://repetae.net/computer/haskell/DrIFT/ For your second problem, something like this: getAB :: Get (Either A B) getAB = do len <- getWord16be tag <- getWord16be if tag == 0x00 then do { a <- getA len; return (Left a) } else do { a <- getB len; return (Right b) } -- length already consumed so sent as an argument... getA :: Word16 -> Get A getB :: Word16 -> Get B