A plain String or Text is dangerous because it can be arbitrarily combined,
converted, emitted, and updated without consideration of the validity and
applicability of the contents and the usage scenario.
This module provides a Named type wrapper around Text which has two
additional type parameters: one which indicates what the content of the Text
represents, and one which indicates the style of the name.
There are additionally functions and classes which allow conversions and
transformations between names with different styles and types (or disallow them
where appropriate).
The core intent of this library is that the Named is used instead of a raw
String or Text to provide type-level tracking and safety.
Changes
Revision history for named-text
1.2.1.0 – 2024-09-19
Allow building withn GHC 9.8 and 9.10.
1.2.0.0 – 2024-07-23
Remove default Eq, Ord, and Hashable instances for all Named. An explicit or
derived instance must be declared for each NamedStyle and/or nameOf variant.
This is to allow a particular NamedStyle or nameOf variant to override the
instance implementation of these functions. Instances are provided the UTF8,
CaseInsensitive, Secure, HTMLStyle, and JSONStyle Named so any module using
only those styles will be backward compatible, but any external named instances
will likely need Eq, Ord, and Hashable instances provided.
Add HTML NameStyle and conversions between HTML and UTF8 name styles.
Add conversion from UTF8 to CaseInsensitive name styles (but not the reverse).