numerals-base-0.3: Convert numbers to number words

Text.Numeral.Exp

Synopsis

Documentation

data Exp Source

An expression that represents the structure of a numeral.

Constructors

Unknown

An unknown value.

Lit

A literal value.

Neg Exp

Negation of an expression.

Add Exp Exp

Addition of two expressions.

Mul Exp Exp

Multiplication of two expressions.

Sub Exp Exp

One expression subtracted from another expression.

Scale Exp

A step in a scale of large values.

Instances

Eq Exp 
Ord Exp 
Show Exp 
Scale Exp

Precisely the Scale constructor.

Sub Exp

Precisely the Sub constructor.

Mul Exp

Precisely the Mul constructor.

Add Exp

Precisely the Add constructor.

Neg Exp

Precisely the Neg constructor.

Lit Exp

Precisely the Lit constructor.

Unknown Exp

Precisely the Unknown constructor.

eval :: (Unknown α, Lit α, Neg α, Add α, Mul α, Sub α, Scale α) => Exp -> αSource

Evaluates an expression to a value.

Law: e == eval e

data Side Source

A side or direction, either Left or Right.

Constructors

L

Left.

R

Right.

Instances