
9 Nov
2010
9 Nov
'10
5:51 a.m.
Thanks Ozgur and Felipe, Could you also show how I could actually use it to parse a bytestring please? import qualified Data.ByteString.Lazy as BS import Control.Applicative ((<$>)) import Data.Word import Data.Binary.Get data MyAction = A1 Word8 | A2 Word16 a,b :: Get MyAction a = A1 <$> getWord8 b = A2 <$> getWord16be listOfActions :: [Get MyAction] listOfActions = [a,b,a] --sequence :: Monad m => [m a] -> m [a] --runGet :: Get a -> ByteString -> a bs = BS.pack [1,0,2] How exactly can I get back a list of integers from bs? -- Regards, Kashyap