Advise-me-0.1: Assessment services for the Advise-Me project

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellSafe
LanguageHaskell98

Recognize.Parsing.Parse

Description

This module defines the parser interface. It consists of three type classes: ParseState, Parse and ParseLog. These three type classes expose the parsing primitives necessary to be implemented by any parser. Although both ParseState and ParseLog are optional, Parse is not.

Synopsis

Documentation

class (Monad m, Alternative m) => Parse m s | m -> s where Source #

Interface for the basic parsing primitives

Methods

(|>) :: m a -> m a -> m a infixl 3 Source #

satisfyWith :: (s -> Maybe a) -> m a Source #

withInputList :: ([s] -> [a]) -> m a Source #

Instances
Monad m => Parse (ParserT st s m) s Source # 
Instance details

Defined in Recognize.Parsing.Parser

Methods

(|>) :: ParserT st s m a -> ParserT st s m a -> ParserT st s m a Source #

satisfyWith :: (s -> Maybe a) -> ParserT st s m a Source #

withInputList :: ([s] -> [a]) -> ParserT st s m a Source #

safePeek :: Parse m s => m (Maybe s) Source #

option :: Parse m s => m a -> m (Maybe a) Source #

satisfy :: Parse m s => (s -> Bool) -> m s Source #

guardBy :: (MonadState st m, Alternative m) => (st -> Bool) -> m () Source #

class ParseLog m where Source #

Interface for monads that are capable of logging.

Methods

pLog :: String -> m () Source #

Instances
ParseLog IO Source # 
Instance details

Defined in Recognize.Parsing.Parse

Methods

pLog :: String -> IO () Source #

ParseLog Identity Source # 
Instance details

Defined in Recognize.Parsing.Parse

Methods

pLog :: String -> Identity () Source #

(Monad m, ParseLog m) => ParseLog (ParserT st s m) Source # 
Instance details

Defined in Recognize.Parsing.Parser

Methods

pLog :: String -> ParserT st s m () Source #