numerals-0.4: Convert numbers to number words

Text.Numeral.Exp

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 i) Precisely the `Unknown` constructor.

class Lit α whereSource

A literal value.

Example in English:

``` "three" = lit 3
```

Methods

lit :: -> αSource

Instances

 Lit ℤ Lit (Exp i) 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 i) Precisely the `Neg` constructor.

Example in English:

``` "fifteen" = lit 5 `add` lit 10
```

Methods

add :: α -> α -> αSource

Instances

 Add ℤ Add (Exp i) 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 i) Precisely the `Mul` constructor.

class Sub α whereSource

One value subtracted from another value.

Example in Latin:

``` "duodēvīgintī" = lit 2 `sub` (lit 2 `mul` lit 10)
```

Methods

sub :: α -> α -> αSource

Instances

 Sub ℤ Sub (Exp i) Precisely the `Sub` constructor.

class Frac α whereSource

A fraction.

Example in English:

``` "two thirds" = `frac` (lit 2) (lit 3)
```

Methods

frac :: α -> α -> αSource

Instances

 Frac (Exp i) Precisely the `Frac` 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

Arguments

 :: ℤ Base. -> ℤ Offset. -> α Rank. -> α

Instances

 Scale ℤ Scale (Exp i) Precisely the `Scale` constructor.

class Dual α whereSource

A dual of a value.

This is used in some languages that express some values as the dual of a smaller value. For instance, in Hebrew the number 20 is expressed as the dual of 10.

Methods

dual :: α -> αSource

Instances

 Dual (Exp i) Precisely the `Dual` constructor.

class Plural α whereSource

A plural of a value.

This is used in some languages that express some values as the plural of a smaller value. For instance, in Hebrew the numbers [30,40..90] are expressed as the plurals of [3..9].

Methods

plural :: α -> αSource

Instances

 Plural (Exp i) Precisely the `Plural` constructor.

class Inflection α whereSource

A change of inflection.

This is used in a language like Spanish where the inflection of a number word is not always constant. Specifically, in Spanish, large number names always have the masculine gender. So 'millón', 'billón' and the like are all masculine. This can result in the following number word: 10000001 = un (masculine) millón una (feminine)

Associated Types

type Inf α Source

Methods

inflection :: (Inf α -> Inf α) -> α -> αSource

Instances

 Inflection (Exp i) Precisely the `Inflection` constructor.