monadic parser :: lpaste — Lambda pastebin

λ Browse Contact monadic parser Edit - Annotate - Report/Delete - Raw - Clone in IDE Paste: #151381 Author(s): mniip Language: Haskell Channel: #haskell Context in IRC logs Created: 2016-01-31 22:47:14 UTC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import Control . Applicative import Control . Monad import Control . Monad . Trans . Free import Control . Monad . State -- A 'Parser b t a' is a parser that consumes a stream of 't' tokens and yields -- an 'a' value, while operating under the 'b' backtracking monad. For most -- purposes, 'b' should be a MonadPlus. Useful examples include '[]' for full -- backtracking, 'Maybe' for no backtracking, 'StateT []' for parsers that need -- additional state which is automagically rollbacked when backtracking, and so -- on. -- FreeT automagically provides us with (correct) instanc...

Linked on 2016-02-02 07:41:15 | Similar Links