LobsterLang-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Parse

Synopsis

Documentation

data Parser a Source #

Constructors

Parser 

Fields

Instances

Instances details
Alternative Parser Source #

Instance Alternative of the data Parser

Instance details

Defined in Parse

Methods

empty :: Parser a #

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

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

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

Applicative Parser Source #

Instance Applicative of the data Parser

Instance details

Defined in Parse

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 #

Functor Parser Source #

Instance Functor of the data Parser

Instance details

Defined in Parse

Methods

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

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

Monad Parser Source #

Instance Monad of the data Parser

Instance details

Defined in Parse

Methods

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

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

return :: a -> Parser a #

parseChar :: Char -> Parser Char Source #

Parse a character c Takes the character that need to be parsed Returns a data Parser that contain the character and the rest of the string

parseOr :: Parser a -> Parser a -> Parser a Source #

Parse with the first or the second parser Takes two parsers Returns either the first parser or the second parser

parseAnd :: Parser a -> Parser b -> Parser (a, b) Source #

Parse with the first and the second parser Takes two parsers Returns either the first parser then use result for the second parser

parseAndWith :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source #

Parse with function after the two parsers Takes two parsers and a fh (x _ -> x) unction Returns the result of the function with the result of the parseAnd

parseMany :: Parser a -> Parser [a] Source #

Parse with a parser Takes a parser Returns the application of the parser (if nothing, returns an empty list)

parseSome :: Parser a -> Parser [a] Source #

Parse with a parser Takes a parser Returns the application of the parser at least one time or Returns Nothing

parseUInt :: Parser Int Source #

Return a data Parser that parse a UInt

parseInt :: Parser Int Source #

Return a data Parser that parse a Int

parseAnyChar :: String -> Parser Char Source #

Parse any character from a String Return a Parser that parse every character from a String

parseList :: Parser a -> String -> String -> Parser [a] Source #

Parse a list of element Return a Parser of list element that start with a '(' and end with a ')'

parseString :: Parser String Source #

Return a data Parser that parse a String

parseSign :: Parser Char Source #

Return a data Parser that parse a - or +

parseDigit :: Parser Char Source #

Return a data Parser that parse a digit

parseBool :: Parser Ast Source #

Return a Parser that parse a Bool (#f or #t)

parseAst :: Parser Ast Source #

Return a Parser that parse a SExpr

parseElem :: Parser a -> Parser a Source #

Parse with a parser and, if possible with a space Return a Parser that parse element with the given parser and, if possible with multiple space

parseValue :: Parser Ast Source #

Return a data Parser that parse a Int as a Value

parseAnyString :: String -> Parser String Source #

Parse a specific String

parseTrue :: Parser Bool Source #

Return a PArser that parse a True (in lisp -> #t)

parseFalse :: Parser Bool Source #

Return a PArser that parse a True (in lisp -> #f)

parseAstString :: Parser Ast Source #

Return a data Parser that parse a String as a Symbol