2010/11/9 Ozgur Akgun <ozgurak...@gmail.com>: > If we change the code a bit, > > data MyAction = A1 Word8 | A2 Word16 > > a,b :: Get MyAction > > a = A1 <$> getWord8 > > b = A2 <$> getWord16be > > listOfActions :: [Get MyAction] > listOfActions = [a,b,a] > Now, we know how to execute the list of actions, and get the output as list. > Using the following guys: > sequence :: Monad m => [m a] -> m [a] > runGet :: Get a -> ByteString -> a
The original question was (I believe) how to drive the parsing with a list of Actions, not the result be a list of Actions. Cheers, Thu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe