The numerals package

[Tags: bsd3, library]

[Skip to ReadMe]


Versions0.1, 0.3,, 0.4
Change logNone available
Dependenciesbase (>=2), bytestring (>=0.9 && <1), dstring (<0.3), mtl (==1.1.*), pretty (>=1 && <1.1), text (==0.1.*) [details]
Copyright(c) 2009 Roel van Dijk, Bas van Dijk
AuthorRoel van Dijk <>, Bas van Dijk <>
MaintainerRoel van Dijk <>, Bas van Dijk <>
CategoryNatural Language Processing, Numerical, Text
UploadedSun Apr 19 18:38:54 UTC 2009 by RoelVanDijk
Downloads792 total (8 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




specialiseSpecialise the polymorphic language definitions to some often used types (String, ByteString, DString). Note that this increases compilation time and the size of the object files significantly. Also see READMEDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainers' corner

For package maintainers and hackage trustees

Readme for numerals-0.1


This is a small note on the Specialise flag.

All the language definitions (Text.Numeral.Language.*) are polymorphic
in their stringlike type. For example:

> nl :: (IsString s, Joinable s) => NumConfig s

This allows the user to choose whatever stringlike type she wants.

If you turn on the Specialise flag then specialised versions of the
language definitions will be build:

> import qualified Data.ByteString as B
> import qualified Data.DString    as DS
> {-# SPECIALISE nl :: NumConfig String #-}
> {-# SPECIALISE nl :: NumConfig B.ByteString #-}
> {-# SPECIALISE nl :: NumConfig DS.DString #-}
> #endif

The idea is that user code which uses any of the specialised types
will become more efficient because the overloading overhead has been
removed. Of course if we specialise the library will take longer to
compile and will be bigger.

The following will discuss some actual numbers:

Without Specialise

$ cabal configure

$ time cabal build

$ du -b dist/build/libHSnumerals-0.1.a
605574	dist/build/libHSnumerals-0.1.a

With Specialise

$ cabal configure --flags="Specialise"

$ time cabal build

$ du -b dist/build/libHSnumerals-0.1.a
2064852	dist/build/libHSnumerals-0.1.a


If we specialise then:
* compilation will take almost 3 times longer
* the library will be at least 3 times bigger

TODO: Check for peformance gains!