fluent
Safe HaskellNone
LanguageHaskell2010

Language.Fluent.Locale.English

Description

This module provides a small English locale.

The locale is intended for tests and experimentation, not for production use.

Supported

  • Cardinal and ordinal plural rules.
  • Decimal, percent, currency and unit numbers.
  • Dates and times in UTC.

Limitations

  • No regional differences are supported. Every language code with language en, such as en-US and en-GB, gives the same output.
  • With the currency display symbol, only currencies in currencies have a symbol. Any other currency is shown by its ISO 4217 code.
  • The currency display name is not supported. It shows the ISO 4217 code like code, so EUR gives EUR 12.50, not 12.50 euros.
  • Only units in units are supported. Any other unit fails.
  • The unit displays narrow and long are not supported. They show the same abbreviation as short, so long gives 3 s, not 3 seconds.
  • Significant digits have no effect.
  • Era and time zone name fields are left out of dates.
  • Time zones other than UTC fail.
Synopsis

Documentation

data English Source #

A small English locale.

See the module documentation for the full list of limitations.

Constructors

English 

Instances

Instances details
Locale English Source #
fromCode
Accepts any code with language "en", ignoring case:
  • "en", "EN", "en-US", and "en_AU" all yield English.
  • "english" is rejected.
toCode
Always yields "en".
displayLanguage
Always yields "English".
pluralCategory
  • Cardinal: One for an absolute value of exactly 1 with zero fraction digits; Other for all other numbers.
  • Ordinal: One for numbers ending in 1; Two for numbers ending in 2; Few for numbers ending in 3; Other for all other integers, fractions, and values beyond Int.
formatNumber
Uses sign, prefix, digits, and suffix layout.
  • Grouping uses commas by default unless disabled.
  • Percent multiplies by 100 and appends a no-break space and "%".
  • Currency defaults to ISO 4217 fractional digits, e.g., 0 for JPY.
  • Units append a no-break space and abbreviation, pluralizing day, week, month, and year with an "s" unless the category is "one".
formatTime
Renders UTC date and time layouts:
  • Fails if the time zone is anything other than UTC.
  • Joins weekday, date, and time fields with ", ".
  • Numeric months, e.g. "21/08/2026"
  • Full month names, e.g. "21 August 2026"
Instance details

Defined in Language.Fluent.Locale.English

units :: HashMap Text Text Source #

The abbreviations of units of measurement, in the singular, by their CLDR identifier.

currencies :: HashMap Text Text Source #

The symbols of currencies by their ISO 4217 code.

currencyDigits :: Text -> Int Source #

The number of digits after the decimal point of an amount of a currency by its ISO 4217 code.