texts-0.3.2: User-facing operations for dealing with texts

Safe HaskellSafe-Inferred
LanguageHaskell98

Texts.English

Contents

Description

English-focused text operations.

Synopsis

Marketing

bigUp :: Integral a => a -> SText Source

Given an integral number, give it a vague English description which makes it seem better than it is. Examples: <3 -> a couple, <1000 -> hundreds, etc.

Time

relativeTimes Source

Arguments

:: UTCTime

The later time span.

-> UTCTime

The earlier time span.

-> Bool

Display 'in/ago'?

-> SText

Example: '3 seconds ago', 'in three days'.

Display a time span as one time relative to another.

Typography

ellipsize :: Int -> SText -> SText Source

Limit the length of the string and ellipsize it.

English numbers

ordSuffix :: Integral n => n -> SText Source

Add a suffix to an integral, e.g. 1st, 2nd, 3rd, 21st.

English grammar

indefinite :: SText -> SText Source

The indefinite article to be used before a word, e.g. "An" elephant, "a" car, etc.

Letter information

isVowel :: Char -> Bool Source

Is a character a vowel?

isConsonant :: Char -> Bool Source

Is a character a consonant?