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

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to