This module provides some simple parser combinators.
Author: Jan Tikovsky
Version: October 2017
yield
:: a -> Parser b a
|
(<*)
:: Parser a b -> Parser a c -> Parser a b
sequential application of two parsers keeping the result of the first one |
(*>)
:: Parser a b -> Parser a c -> Parser a c
sequential application of two parsers keeping the result of the second one |
(<|>)
:: Parser a b -> Parser a b -> Parser a b
alternative application of two parsers |
eof
:: Parser a b
|
unexpected
:: Show a => a -> Parser a b
|
terminal
:: (Eq a, Show a) => a -> Parser a ()
|
many
:: Parser a b -> Parser a [b]
star operation on parsers
|
some
:: Parser a b -> Parser a [b]
plus operation on parsers
|
(<$>)
:: Monad a => (b -> c) -> a b -> a c
Apply a pure function to the result of a monadic action. |
(<*>)
:: Monad a => a (b -> c) -> a b -> a c
Apply a function originating from the first monadic computation to the result of the second monadic action. |
Constructors:
Parser
:: ([a] -> Either String ([a],b)) -> Parser a b
Fields:
runParser
:: ([a] -> Either String ([a],b))
sequential application of two parsers keeping the result of the first one
|
sequential application of two parsers keeping the result of the second one
|
alternative application of two parsers
|
|
Apply a pure function to the result of a monadic action.
|
Apply a function originating from the first monadic computation to the result of the second monadic action.
|