numerals-0.1: Utilities for working with numerals

Text.Numeral

Contents

Synopsis

Types

data NumConfig s Source

Constructors

NumConfig 

Fields

ncCardinal :: Integer -> Maybe (NumSymbol s)
 
ncNeg :: s -> s
 
ncOne :: (Integer, s) -> s
 
ncAdd :: (Integer, s) -> (Integer, s) -> s
 
ncMul :: (Integer, s) -> (Integer, s) -> s
 

data SymbolType Source

Constructors

Terminal 
Add 
Mul 

Instances

data Gender Source

Grammatical gender

Constructors

Neuter 
Masculine 
Feminine 

Instances

Cardinals

Smart NumSymbol constructors

Symbol representation helper functions

gender :: s -> s -> Gender -> sSource

genderN :: s -> s -> s -> Gender -> sSource

tenForms :: s -> s -> s -> SymbolContext -> sSource

Constructs a symbol representation based on the relation of the symbol with the number 10. The chosen representation depends on the context in which the symbol is used: d) default: x a) additive: 10 + x m) multiplicative: x * 10

tenFormsG :: (Gender -> s) -> (Gender -> s) -> (Gender -> s) -> Gender -> SymbolContext -> sSource

tenForms' :: s -> s -> s -> s -> SymbolContext -> sSource

Constructs a symbol representation based on the relation of the symbol with the number 10. The chosen representation depends on the context in which the symbol is used: d) default: x a) additive: 10 + x mt) multiplicative: x * 10 mh) multiplicative: x * 100

mulForms :: s -> s -> SymbolContext -> sSource