-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Convert numbers to number words
--
-- Convert numbers to number words in a number of languages. Each
-- language has its own module. The module name is based on one of the
-- ISO 639 Alpha codes. Each module contains one or more cardinal
-- functions and a struct function. The cardinal functions
-- directly convert cardinal numbers to a string-like representation of
-- their spoken form. The struct functions convert numbers to a
-- polymorphic representation of their grammatical structure. All
-- language modules are implemented using the numerals-base
-- package.
--
-- The use of this package is best understood with some examples. Because
-- the results of conversion are polymorphic we need to choose a specific
-- type. For these examples we'll use simple strings. But any type that
-- has instances for Monoid and IsString will work. First
-- some English number names, both British and US variants:
--
--
-- >>> import qualified Text.Numeral.Language.EN as EN
--
-- >>> EN.uk_cardinal 123 :: Maybe String
-- Just "one hundred and twenty-three"
--
-- >>> EN.us_cardinal (10^50 + 42) :: Maybe String
-- Just "one hundred quindecillion forty-two"
--
--
-- French, which contains some traces of a base 20 system:
--
--
-- >>> import qualified Text.Numeral.Language.FR as FR
--
-- >>> FR.cardinal (-99) :: Maybe String
-- Just "moins quatre-vingt-dix-neuf"
--
--
-- Conversions can fail. Alamblak, a language spoken by a few people in
-- Papua New Guinea, has no representation for negative numbers:
--
--
-- >>> import qualified Text.Numeral.Language.AMP as AMP
--
-- >>> AMP.cardinal (-3) :: Maybe String
-- Nothing
--
--
-- Some languages have multiple scripts and methods for writing number
-- names. Take Chinese for example, which can be written using Han
-- characters or transcribed to the Latin script using Pinyin.
--
-- Traditional Chinese characters:
--
--
-- >>> import qualified Text.Numeral.Language.ZH as ZH
--
-- >>> ZH.trad_cardinal 123456 :: Maybe String
-- Just "十二萬三千四百五十六"
--
--
-- Simplified characters for use in financial contexts:
--
--
-- >>> ZH.finance_simpl_cardinal 123456 :: Maybe String
-- Just "拾贰万参仟肆伯伍拾陆"
--
--
-- Transcribed using Pinyin:
--
--
-- >>> ZH.pinyin_cardinal 123456 :: Maybe String
-- Just "shíèrwàn sānqiān sìbǎi wǔshí liù"
--
--
-- Using the struct functions you can see the grammatical
-- structure of number names. Because the results of these functions are
-- polymorphic you need to specify a specific type.
--
--
-- >>> import qualified Text.Numeral.Language.NL as NL
--
-- >>> NL.struct 123 :: Maybe Integer
-- Just 123
--
-- >>> import Text.Numeral
--
-- >>> NL.struct 123 :: Maybe Exp
-- Just (Add (Lit 100) (Add (Lit 3) (Mul (Lit 2) (Lit 10))))
--
--
-- Compare with:
--
--
-- >>> NL.cardinal 123 :: Maybe String
-- Just "honderddrieëntwintig"
--
--
-- 100 (honderd) + (3 (drie) + (ën) 2 (twin) * 10 (tig))
@package numerals
@version 0.3.0.1
-- |
-- - ISO639-1 zh
-- - ISO639-2B chi
-- - ISO639-2T zho
-- - ISO639-3 cmn
-- - Native name
-- - English name Chinese
--
module Text.Numeral.Language.ZH
struct :: (Integral α, Unknown β, Lit β, Neg β, Add β, Mul β) => α -> β
trad_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
simpl_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
finance_trad_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
finance_simpl_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
pinyin_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
-- |
-- - ISO639-1 yo
-- - ISO639-2 yor
-- - ISO639-3 yor
-- - Native name d Yorb
-- - English name Yoruba
--
module Text.Numeral.Language.YOR
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Sub β, Mul β) => α -> β
-- |
-- - ISO639-1 wo
-- - ISO639-2 wo1
-- - ISO639-3 wo1
-- - Native name Wolof
-- - English name Wolof
--
module Text.Numeral.Language.WO
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 tr
-- - ISO639-2 tur
-- - ISO639-3 tur
-- - Native name Trke
-- - English name Turkish
--
module Text.Numeral.Language.TR
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 sv
-- - ISO639-2B swe
-- - ISO639-3 swe
-- - Native name svenska
-- - English name Swedish
--
module Text.Numeral.Language.SV
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 -
-- - ISO639-2 sco
-- - ISO639-3 sco
-- - Native name Scots
-- - English name Scots
--
module Text.Numeral.Language.SCO
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 ru
-- - ISO639-2 rus
-- - ISO639-3 rus
-- - Native name
-- - English name Russian
--
module Text.Numeral.Language.RU
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Neg β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 pt
-- - ISO639-2 por
-- - ISO639-3 por
-- - Native name Portugus
-- - English name Portuguese
--
module Text.Numeral.Language.PT
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 oj
-- - ISO639-2 oji
-- - ISO639-3 oji
-- - Native name (Anishinaabemowin)
-- - English name Ojibwe
--
module Text.Numeral.Language.OJ
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 -
-- - ISO639-2B -
-- - ISO639-3 nqm
-- - Native name -
-- - English name Ndom
--
module Text.Numeral.Language.NQM
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 nb
-- - ISO639-2B nob
-- - ISO639-3 nob
-- - Native name Bokml
-- - English name Norwegian Bokml
--
module Text.Numeral.Language.NO
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Neg β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 nl
-- - ISO639-2B dut
-- - ISO639-3 nld
-- - Native name Nederlands
-- - English name Dutch
--
module Text.Numeral.Language.NL
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 mg
-- - ISO639-2 mlg
-- - ISO639-3 mlg
-- - Native name -
-- - English name Malagasy
--
module Text.Numeral.Language.MG
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 la
-- - ISO639-2B lat
-- - ISO639-3 lat
-- - Native name Latine
-- - English name Latin
--
module Text.Numeral.Language.LA
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Sub β, Mul β) => α -> β
-- |
-- - ISO639-1 ja
-- - ISO639-2B jpn
-- - ISO639-3 jpn
-- - Native name
-- - English name Japanese
--
module Text.Numeral.Language.JA
struct :: (Integral α, Unknown β, Lit β, Neg β, Add β, Mul β) => α -> β
kanji_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
daiji_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
on'yomi_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
preferred_cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
-- |
-- - ISO639-1 it
-- - ISO639-2B ita
-- - ISO639-3 ita
-- - Native name Italiano
-- - English name Italian
--
module Text.Numeral.Language.IT
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 gv
-- - ISO639-2 glv
-- - ISO639-3 glv
-- - Native name Gaelg
-- - English name Manx
--
module Text.Numeral.Language.GV
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 fr
-- - ISO639-2B fre
-- - ISO639-3 fra
-- - Native name Franais
-- - English name French
--
module Text.Numeral.Language.FR
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 es
-- - ISO639-2B spa
-- - ISO639-3 spa
-- - Native name Espaol
-- - English name Spanish
--
module Text.Numeral.Language.ES
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 eo
-- - ISO639-2B epo
-- - ISO639-3 epo
-- - Native name Esperanto
-- - English name Esperanto
--
module Text.Numeral.Language.EO
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 en
-- - ISO639-2B eng
-- - ISO639-3 eng
-- - Native name English
-- - English name English
--
module Text.Numeral.Language.EN
uk_cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
ukPelletier_cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
us_cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
shortScaleStruct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
longScaleStruct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
pelletierScaleStruct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 de
-- - ISO639-2B ger
-- - ISO639-3 deu
-- - Native name Deutsch
-- - English name German
--
module Text.Numeral.Language.DE
cardinal :: (Integral α, Scale α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Scale α, Unknown β, Lit β, Neg β, Add β, Mul β, Scale β) => α -> β
-- |
-- - ISO639-1 -
-- - ISO639-2B chn
-- - ISO639-3 chn
-- - Native name -
-- - English name Chinook Jargon
--
module Text.Numeral.Language.CHN
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β
-- |
-- - ISO639-1 -
-- - ISO639-2 -
-- - ISO639-3 amp
-- - Native name -
-- - English name Alamblak
--
module Text.Numeral.Language.AMP
cardinal :: (Integral α, Monoid s, IsString s) => α -> Maybe s
struct :: (Integral α, Unknown β, Lit β, Add β, Mul β) => α -> β