HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerebase-1.21.2Haskell2010

Rebase.Data.Text.Internal

  • 2 types
  • 11 values
  • Packagerebase-1.21.2
  • Exports13
  • LanguageHaskell2010
  • LicenceMIT
  • SourceInternal.hs
valuetext
  1. :: Array

    bytearray encoded as UTF-8

  2. -> Int

    offset in bytes (not in Char!), pointing to a start of UTF-8 sequence

  3. -> Int

    length in bytes (not in Char!), pointing to an end of UTF-8 sequence

  4. -> Text
#

Construct a Text without invisibly pinning its byte array in memory if its length has dwindled to zero. It ensures that empty Text values are shared.

valuesafe :: Char -> Char
#

Map a Char to a Text-safe value.

Unicode Surrogate code points are not included in the set of Unicode scalar values, but are unfortunately admitted as valid Char values by Haskell. They cannot be represented in a Text. This function remaps those code points to the Unicode replacement character (U+FFFD, '�'), and leaves other code points unchanged.

datadata Text
#

A space efficient, packed, unboxed Unicode text type.

Constructors

Instances15IsList, Eq, Data, Ord, Read, Show, …
  • IsList TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedLists['\55555'] :: Text"\65533"
  • Eq TextDefined in text-2.1.3 · Data.Text · orphan
  • Data TextDefined in text-2.1.3 · Data.Text · orphan

    This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.

    This instance was created by copying the updated behavior of Data.Set.Set and Data.Map.Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

    The original discussion is archived here: could we get a Data instance for Data.Text.Text?

    The followup discussion that changed the behavior of Set and Data.Map.Map is archived here: Proposal: Allow gunfold for Data.Map, ...

  • Ord TextDefined in text-2.1.3 · Data.Text · orphan
  • Read TextDefined in text-2.1.3 · Data.Text · orphan
  • Show TextDefined in text-2.1.3 · Data.Text.Show · orphan
  • IsString TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Text"\65533"
  • Semigroup TextDefined in text-2.1.3 · Data.Text · orphan

    Beware: stimes will crash if the given number does not fit into an Int.

  • Monoid TextDefined in text-2.1.3 · Data.Text · orphan
  • PrintfArg TextDefined in text-2.1.3 · Data.Text · orphan
  • NFData TextDefined in text-2.1.3 · Data.Text · orphan
  • Binary TextDefined in text-2.1.3 · Data.Text · orphan
  • Hashable TextDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift TextDefined in text-2.1.3 · Data.Text · orphan
  • type Item Text = CharDefined in text-2.1.3 · Data.Text · orphan
valuefirstf :: (a -> c) -> Maybe (a, b) -> Maybe (c, b)
#

Apply a function to the first element of an optional pair.

valuemul :: Int -> Int -> Int
#

Checked multiplication. Calls error if the result would overflow.

valuepack :: String -> Text
#

O(n) Convert a String into a Text. Performs replacement on invalid scalar values, so unpack . pack is not id:

Example1 expression
Data.Text.unpack (pack "\55555")"\65533"