libcspm-1.0.0: A library providing a parser, type checker and evaluator for CSPM.

Safe HaskellSafe-Inferred

Util.Precedence

Synopsis

Documentation

class Precedence a whereSource

Methods

precedence :: a -> IntSource

Returns the binding strength of the operator. Higher numbers bind more loosely.

associativity :: a -> AssociativitySource

Returns the associativity of the operator.

sameOperator :: a -> a -> BoolSource

True if the two items are the same operator. This is used to decide when to paranthesise.

Instances

Precedence Type 
Precedence (Proc seq CSPOperator pn ev evs (seq (ev, ev))) 

data Associativity Source

The associativity of an operator