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

Safe HaskellNone
LanguageHaskell2010

Hledger.Utils.Parse

Contents

Synopsis

Documentation

type SimpleStringParser a = Parsec CustomErr String a #

A parser of string to some type.

type SimpleTextParser = Parsec CustomErr Text #

A parser of strict text to some type.

type TextParser m a = ParsecT CustomErr Text m a #

A parser of text in some monad.

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

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

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

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

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

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

surroundedBy :: Applicative m => m openclose -> m a -> m a #

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

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

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

re-exports

data CustomErr #

A custom error type for the parser. The type is specialized to parsers of Text streams.