Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SimpleStringParser a = Parsec CustomErr String a
- type SimpleTextParser = Parsec CustomErr Text
- type TextParser m a = ParsecT CustomErr Text m a
- type JournalParser m a = StateT Journal (ParsecT CustomErr Text m) a
- type ErroringJournalParser m a = StateT Journal (ParsecT CustomErr Text (ExceptT FinalParseError m)) a
- choice' :: [TextParser m a] -> TextParser m a
- choiceInState :: [StateT s (ParsecT CustomErr Text m) a] -> StateT s (ParsecT CustomErr Text m) a
- surroundedBy :: Applicative m => m openclose -> m a -> m a
- parsewith :: Parsec e Text a -> Text -> Either (ParseErrorBundle Text e) a
- parsewithString :: Parsec e String a -> String -> Either (ParseErrorBundle String e) a
- parseWithState :: Monad m => st -> StateT st (ParsecT CustomErr Text m) a -> Text -> m (Either (ParseErrorBundle Text CustomErr) a)
- parseWithState' :: Stream s => st -> StateT st (ParsecT e s Identity) a -> s -> Either (ParseErrorBundle s e) a
- fromparse :: (Show t, Show (Token t), Show e) => Either (ParseErrorBundle t e) a -> a
- parseerror :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> a
- showDateParseError :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> String
- nonspace :: TextParser m Char
- isNonNewlineSpace :: Char -> Bool
- restofline :: TextParser m String
- eolof :: TextParser m ()
- spacenonewline :: (Stream s, Char ~ Token s) => ParsecT CustomErr s m Char
- skipNonNewlineSpaces :: (Stream s, Token s ~ Char) => ParsecT CustomErr s m ()
- skipNonNewlineSpaces1 :: (Stream s, Token s ~ Char) => ParsecT CustomErr s m ()
- skipNonNewlineSpaces' :: (Stream s, Token s ~ Char) => ParsecT CustomErr s m Bool
- data CustomErr
Documentation
type JournalParser m a = StateT Journal (ParsecT CustomErr Text m) a Source #
A parser of text that runs in some monad, keeping a Journal as state.
type ErroringJournalParser m a = StateT Journal (ParsecT CustomErr Text (ExceptT FinalParseError m)) a Source #
A parser of text that runs in some monad, keeping a Journal as state, that can throw an exception to end parsing, preventing further parser backtracking.
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 CustomErr Text m) a] -> StateT s (ParsecT CustomErr Text m) a Source #
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 Source #
parsewithString :: Parsec e String a -> String -> Either (ParseErrorBundle String e) a Source #
parseWithState :: Monad m => st -> StateT st (ParsecT CustomErr Text m) a -> Text -> m (Either (ParseErrorBundle Text CustomErr) a) Source #
Run a stateful parser with some initial state on a text. See also: runTextParser, runJournalParser.
parseWithState' :: Stream s => st -> StateT st (ParsecT e s Identity) a -> s -> Either (ParseErrorBundle s e) a Source #
parseerror :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> a Source #
showDateParseError :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> String Source #
nonspace :: TextParser m Char Source #
isNonNewlineSpace :: Char -> Bool Source #
restofline :: TextParser m String Source #
eolof :: TextParser m () Source #
re-exports
A custom error type for the parser. The type is specialized to
parsers of Text
streams.
Instances
Eq CustomErr Source # | |
Ord CustomErr Source # | |
Defined in Text.Megaparsec.Custom | |
Show CustomErr Source # | |
ShowErrorComponent CustomErr Source # | |
Defined in Text.Megaparsec.Custom showErrorComponent :: CustomErr -> String # errorComponentLen :: CustomErr -> Int # | |
Ord (ParseError Text CustomErr) Source # | |
Defined in Text.Megaparsec.Custom compare :: ParseError Text CustomErr -> ParseError Text CustomErr -> Ordering # (<) :: ParseError Text CustomErr -> ParseError Text CustomErr -> Bool # (<=) :: ParseError Text CustomErr -> ParseError Text CustomErr -> Bool # (>) :: ParseError Text CustomErr -> ParseError Text CustomErr -> Bool # (>=) :: ParseError Text CustomErr -> ParseError Text CustomErr -> Bool # max :: ParseError Text CustomErr -> ParseError Text CustomErr -> ParseError Text CustomErr # min :: ParseError Text CustomErr -> ParseError Text CustomErr -> ParseError Text CustomErr # |