conditional-restriction-parser-0.1.0.4: Parser and interpreter of OpenStreetMap conditional restriction values
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConditionalRestriction.Parse

Description

This module reexports functions and types you are most likely to use from ConditionalRestriction.Parse.*.

Synopsis

Documentation

data Parser i a Source #

A generic parser. Takes an input type i and returns an output type a.

Instances

Instances details
Alternative (Parser i) Source # 
Instance details

Defined in ConditionalRestriction.Internal.Parse.ParserLib

Methods

empty :: Parser i a #

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

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

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

Applicative (Parser i) Source # 
Instance details

Defined in ConditionalRestriction.Internal.Parse.ParserLib

Methods

pure :: a -> Parser i a #

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

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

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

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

Functor (Parser i) Source # 
Instance details

Defined in ConditionalRestriction.Internal.Parse.ParserLib

Methods

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

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

Monad (Parser i) Source # 
Instance details

Defined in ConditionalRestriction.Internal.Parse.ParserLib

Methods

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

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

return :: a -> Parser i a #

parse :: Parser i a -> i -> Result String (a, i) Source #

pConditionalRestriction :: Parser String ConditionalRestriction Source #

Parse conditional restrictions, e.g. "90 @ 18:00-22:00; 50 @ wet".

pValue :: Parser String Value Source #

Parses Values. See pBool, pNum and pTime for formats.

pOpeningHours :: Parser String OpeningHours Source #

Parse opening hours, e.g. "Di-Fr 08:00-20:00".

data Condition Source #

AST representation of a condition.

Instances

Instances details
Show Condition Source # 
Instance details

Defined in ConditionalRestriction.Parse.AST

Eq Condition Source # 
Instance details

Defined in ConditionalRestriction.Parse.AST

data OpeningHours Source #

AST representation of opening hours. Not complete.

type ID = String Source #

An identifier, identifying a value, e.g. "weight".

data Value Source #

Input data value, corresponding to input Types.

Constructors

VBool Bool

Boolean value, e.g. "true".

VNum Double

Number value, e.g. "3.0".

VTime DateTime

Time value, e.g. "2022-05-10 18:00".

Instances

Instances details
Show Value Source # 
Instance details

Defined in ConditionalRestriction.Parse.InputData

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

Eq Value Source # 
Instance details

Defined in ConditionalRestriction.Parse.InputData

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

data Type Source #

Input data type.

Constructors

TBool

Boolean type, e.g. value "true".

TNum

Number type, e.g. value "3.0".

TTime

Time type, e.g. value "2022-05-10 18:00".

Instances

Instances details
Show Type Source # 
Instance details

Defined in ConditionalRestriction.Parse.InputData

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type Source # 
Instance details

Defined in ConditionalRestriction.Parse.InputData

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

type Token = String Source #

A single token. Is used to represent values of any kind that the parser does not touch.