numerals-base-0.3: Convert numbers to number words

Text.Numeral.Exp.Classes

Synopsis

Documentation

class Unknown α whereSource

An unknown value. This is used to signal that a value can not be represented in the expression language.

Law: isUnknown unknown == True

Methods

unknown :: αSource

isUnknown :: α -> BoolSource

Instances

Unknown  
Unknown Exp

Precisely the Unknown constructor.

class Lit α whereSource

A literal value.

Example in English:

 "three" = lit 3

Methods

lit :: -> αSource

Instances

Lit  
Lit Exp

Precisely the Lit constructor.

class Neg α whereSource

Negation of a value.

Example in English:

 "minus two" = neg (lit 2)

Methods

neg :: α -> αSource

Instances

Neg  
Neg Exp

Precisely the Neg constructor.

class Add α whereSource

Addition of two values.

Example in English:

 "fifteen" = lit 5 `add` lit 10

Methods

add :: α -> α -> αSource

Instances

Add  
Add Exp

Precisely the Add constructor.

class Mul α whereSource

Multiplication of two values.

Example in English:

 "thirty" = lit 3 `mul` lit 10

Methods

mul :: α -> α -> αSource

Instances

Mul  
Mul Exp

Precisely the Mul constructor.

class Sub α whereSource

One value subtracted from another value.

Example in Latin:

 "duodvgint" = lit 2 `sub` (lit 2 `mul` lit 10)

Methods

sub :: α -> α -> αSource

Instances

Sub  
Sub Exp

Precisely the Sub constructor.

class Scale α whereSource

A step in a scale of large values.

Should be interpreted as 10 ^ (rank * base + offset).

Example in English:

 "quadrillion" = scale 3 3 4

Methods

scaleSource

Arguments

::

Base.

->

Offset.

-> α

Rank.

-> α 

Instances

Scale  
Scale Exp

Precisely the Scale constructor.