autoproof-0.0.0.0: Propositional logic library
Copyright(c) Artem Mavrin 2021
LicenseBSD3
Maintainerartemvmavrin@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

AutoProof.Internal.Utils.Parser.Types

Description

Defines a lightweight parser type.

Synopsis

Documentation

newtype Parser a Source #

The Parser type is a simple state monad with state type String and inner monad Maybe.

Constructors

Parser 

Fields

Instances

Instances details
Monad Parser Source # 
Instance details

Defined in AutoProof.Internal.Utils.Parser.Types

Methods

(>>=) :: Parser a -> (a -> Parser b) -> Parser b #

(>>) :: Parser a -> Parser b -> Parser b #

return :: a -> Parser a #

Functor Parser Source # 
Instance details

Defined in AutoProof.Internal.Utils.Parser.Types

Methods

fmap :: (a -> b) -> Parser a -> Parser b #

(<$) :: a -> Parser b -> Parser a #

Applicative Parser Source # 
Instance details

Defined in AutoProof.Internal.Utils.Parser.Types

Methods

pure :: a -> Parser a #

(<*>) :: Parser (a -> b) -> Parser a -> Parser b #

liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #

(*>) :: Parser a -> Parser b -> Parser b #

(<*) :: Parser a -> Parser b -> Parser a #

Alternative Parser Source # 
Instance details

Defined in AutoProof.Internal.Utils.Parser.Types

Methods

empty :: Parser a #

(<|>) :: Parser a -> Parser a -> Parser a #

some :: Parser a -> Parser [a] #

many :: Parser a -> Parser [a] #

parse :: Parser a -> String -> Maybe a Source #

Run a parser on a string, discarding any unparsed suffix