HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Data.ShortText

An Unicode string for internal GHC use. Meant to replace String in places where being a lazy linked is not very useful and a more memory efficient data structure is desirable.

  • 1 type
  • 9 values

ShortText

1 declaration
newtypenewtype ShortText
#

A ShortText is a modified UTF-8 encoded string meant for short strings like file paths, module descriptions, etc.

Instances8Eq, Ord, Show, IsString, Semigroup, Monoid, …
  • Eq ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • Ord ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • Show ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • IsString ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • Semigroup ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • Monoid ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • NFData ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText
  • Binary ShortTextDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Data.ShortText

Conversion to and from String

Operations

valuehead :: ShortText -> Char
#

O(1) Returns the first UTF-8 codepoint in the ShortText. Depending on the string in question, this may or may not be the actual first character in the string due to Unicode non-printable characters.