linguistic-ordinals-0.1.0.1: Express Integral types as linguistic ordinals (1st, 2nd, 3rd, etc)

Copyright(c) 2014 Elliot Robinson (c) 2014 Argiope Technical Solutions
LicenseBSD3
MaintainerElliot Robinson <elliot.robinson@argiopetech.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Text.Ordinal

Description

Provides conversion from Integral types to their ordinal ("1st", "2nd", "3rd", etc) counterparts in Text form.

Synopsis

Documentation

showOrdinal :: Integral a => a -> Text Source

Provides the ordinal form of an Integral type as Text

>>> showOrdinal 1001
"1001st"

ordinalSuffix :: Integral a => a -> Text Source

Returns the appropriate ordinal suffix for the provided Integral

>>> map ordinalSuffix [101, 102, 103, 113]
["st", "nd", "rd", "th"]