Copyright | (c) Marcus Völker 2017 |
---|---|
License | MIT |
Maintainer | marcus.voelker@rwth-aachen.de |
Safe Haskell | Safe |
Language | Haskell2010 |
This module implements LParse's atomic parsers, i.e., parsers that are not built up from other parsers.
- noop :: Parser r t ()
- full :: Parser r [t] [t]
- discard :: Parser r [t] ()
- eoi :: Parser r [t] ()
- tokenParse :: (t -> a) -> Parser r [t] a
- tokenReturn :: Parser r [a] a
- consume :: (Eq t, Show t) => [t] -> Parser r [t] ()
- consumeSingle :: (Eq t, Show t) => t -> Parser r [t] ()
- word :: Parser r String String
- integer :: Parser r String Integer
- peek :: (t -> Bool) -> String -> Parser r [t] ()
Documentation
discard :: Parser r [t] () Source #
A parser that consumes the whole input and discards it, successfully
eoi :: Parser r [t] () Source #
A parser that parses nothing, but only succeeds if the input is empty
tokenParse :: (t -> a) -> Parser r [t] a Source #
Extracts the first token from the input and applies the given function to it
tokenReturn :: Parser r [a] a Source #
Consumes and returns the first token of the input
consume :: (Eq t, Show t) => [t] -> Parser r [t] () Source #
Succeeds exactly if the input begins with the given sequence. On success, consumes that sequence
consumeSingle :: (Eq t, Show t) => t -> Parser r [t] () Source #
Succeeds exactly if the input begins with the given token. On success, consumes that token
word :: Parser r String String Source #
Extracts the first word (i.e. contiguous string of letters) from the input and returns it