Safe Haskell | None |
---|
Postfix, or RPN, expression parsing.
This module parses RPN expressions where the operands are
predicates and the operators are one of and
, or
, or not
,
where and
and or
are binary and not
is unary.
- type Error = Text
- data RPNToken a
- = TokOperand (Predbox a)
- | TokOperator Operator
- data Operator
- pushOperand :: Predbox a -> [Predbox a] -> [Predbox a]
- pushOperator :: Operator -> [Predbox a] -> Either Error [Predbox a]
- pushToken :: [Predbox a] -> RPNToken a -> Either Error [Predbox a]
- parseRPN :: Foldable f => f (RPNToken a) -> Either Error (Predbox a)
Documentation
pushOperand :: Predbox a -> [Predbox a] -> [Predbox a]Source