hledger-lib-1.3.1: Core data types, parsers and functionality for the hledger accounting tools

Safe HaskellNone
LanguageHaskell2010

Hledger.Utils.Parse

Synopsis

Documentation

type SimpleStringParser a = Parsec MPErr String a Source #

A parser of string to some type.

type SimpleTextParser = Parsec MPErr Text Source #

A parser of strict text to some type.

type TextParser m a = ParsecT MPErr Text m a Source #

A parser of text in some monad.

type JournalParser m a = StateT Journal (ParsecT MPErr Text m) a Source #

A parser of text in some monad, with a journal as state.

type ErroringJournalParser m a = StateT Journal (ParsecT MPErr Text (ExceptT String m)) a Source #

A parser of text in some monad, with a journal as state, that can throw an error string mid-parse.

choice' :: [TextParser m a] -> TextParser m a Source #

Backtracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail.

choiceInState :: [StateT s (ParsecT MPErr Text m) a] -> StateT s (ParsecT MPErr Text m) a Source #

Backtracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail.

parseWithState' :: Stream s => st -> StateT st (ParsecT e s Identity) a -> s -> Either (ParseError (Token s) e) a Source #

fromparse :: (Show t, Show e) => Either (ParseError t e) a -> a Source #

parseerror :: (Show t, Show e) => ParseError t e -> a Source #