The numerals package

Convert numbers to number words in a number of languages. Each language has
its own module. The module name is based on the ISO 639-3 code for that
language. Each module contains one or more cardinal and ordinal functions
and a struct function. The cardinal functions directly convert cardinal
numbers to a string-like representation of their spoken form. The ordinal
functions do the same but for ordinal numbers. The struct functions convert
numbers to a polymorphic representation of their grammatical structure.
See the Text.Numeral module for information on how to use this library.

Maintainer's Corner

Readme for numerals-0.4.1

Numerals

Convert numbers to number words in a number of languages. Each
language has its own module. The module name is based on the ISO 639-3
code for that language. Each module contains one or more functions to
convert numerical values to numerals. Several types of numerals are
supported. But not every type is supported by every language. Some
because they do not occur in that language. Others because they are
not yet defined in this package.

Cardinal numerals

Describe quantity - one, two, three, etc.

Ordinal numerals

Describe position in a sequential order - first, second,
third, etc.

Partitive numerals

Describe division into fractions - two thirds, three quarters.

Multiplicative numerals

Describe repetition, how many time - once, twice, thrice.

Inflection

In some languages number words are modified based on a number of
grammatical categories such as gender or number. For instance, in
Spanish, the numeral for the quantity '1' can be one of uno, un or
una depending on whether it is of the neuter, masculine or feminine
gender. In order to support this process every conversion function
takes an inflection parameter which defines the grammatical state.

Inflections are not concrete types, but polymorphic parameters
constrained by type classes. Use the reified inflection type provided
by the numerals-base package to get a concrete value:

>>> import Text.Numeral.Grammar.Reified ( defaultInflection )

Numeral structure

The struct functions convert numbers to a polymorphic representation
of their grammatical structure. They are found in every language
module.

Examples

The use of this package is best understood with some examples. First
some English number names, both British and US variants: