penny-lib-0.4.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Infered

Penny.Liberty.Expressions

Synopsis

Documentation

newtype Precedence Source

Precedence can be any integer; the greater the number, the higher the precedence.

Constructors

Precedence Int 

data Associativity Source

Constructors

ALeft 
ARight 

Instances

data Token a Source

Instances

Show a => Show (Token a) 

newtype Operand a Source

An operand; for example, in the expression 5 4 +, 5 and 4 are operands.

Constructors

Operand a 

Instances

Show a => Show (Operand a) 

tokAnd :: Token (a -> Bool)Source

An And token which is left associative with precedence 3.

tokOr :: Token (a -> Bool)Source

An Or token which is left associative with precedence 2.

tokNot :: Token (a -> Bool)Source

A unary prefix Not token with precedence 4.

evaluate :: Foldable l => l (Token a) -> Maybe aSource

Tokens should be enqueued from left to right, so that tokens on the left side of the sequence are those at the beginning of the expression.