prednote-0.26.0.0

Safe HaskellNone

Prednote.Expressions.Infix

Synopsis

Documentation

data Paren Source

Constructors

Open 
Close 

createRPNSource

Arguments

:: Foldable f 
=> f (InfixToken a)

The input tokens, with the beginning of the expression on the left side of the sequence.

-> Maybe [RPNToken a]

The output sequence of tokens, with the beginning of the expression on the left side of the list.

Creates an RPN expression from an infix one. Fails only if there are mismatched parentheses. It is possible to create a nonsensical RPN expression; the RPN parser must catch this.