HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleghc-boot-9.14.1Haskell2010

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.

Contents
  1. ShortText
  2. Conversion to and from String
  3. Operations
Synopsis
  • Packageghc-boot-9.14.1
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceShortText.hs

ShortText

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, …

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.