| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Fluent.Value
Synopsis
Documentation
The concrete representation of a Fluent value, along with any formatting options.
Constructors
| Formatted (forall l. Locale l => NonEmpty l -> Either String Text) | A value with custom locale-aware formatting logic. |
| String Text | Text that is already formatted. |
| Number Scientific NumberOptions | A number and its formatting options. |
| Time UTCTime TimeOptions | A point in time and its formatting options. |
| Invalid String | A failed or invalid argument and the error reason. |
format :: Locale l => NonEmpty l -> Value -> Either String Text Source #
Renders a Value into text for the given locale fallback chain.
asText :: Value -> Text Source #
The raw string representation of a Value without applying locale formatting.
matchesExact :: Value -> Value -> Bool Source #
Whether a selector matches a variant key by exact equality.
matchesCategory :: Locale l => l -> Value -> Value -> Bool Source #
Whether a numeric selector matches a plural category key (e.g. 1 matching "one").
fromIntegral :: Integral a => a -> Value Source #
Converts an integer into an arbitrary-precision numeric Value.
fromFloatDigits :: RealFloat a => a -> Value Source #
class ToValue v where Source #
Types usable as arguments in Fluent message formatting.