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

Moduletext-short-0.1.6Haskell2010

Data.Text.Short.Partial

Partial functions vocabulary

This module provides common partial functions for operating on ShortText.

The use of these functions is discouraged as they tend to be error-prone.

  • 8 values
  • Packagetext-short-0.1.6
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePartial.hs
valueindex :: ShortText -> Int -> Char
#

\mathcal{O}(n) Retrieve i-th character (code-point)

Example1 expression
index "abcd" 1'b'

Note: Will throw an error exception if index is out of bounds. Consider using the total functions indexMaybe or indexEndMaybe instead.

valuefoldl1 :: (Char -> Char -> Char) -> ShortText -> Char
#

\mathcal{O}(n) Reduces the characters of the ShortText with the binary operator.

Example1 expression
foldl1 max "abcdcba"'d'
Example1 expression
foldl1 const "abcd"'a'
Example1 expression
foldl1 (flip const) "abcd"'d'

Note: Will throw an error exception if index is out of bounds.

valuefoldr1 :: (Char -> Char -> Char) -> ShortText -> Char
#

\mathcal{O}(n) Reduces the characters of the ShortText with the binary operator.

Example1 expression
foldr1 max "abcdcba"'d'
Example1 expression
foldr1 const "abcd"'a'
Example1 expression
foldr1 (flip const) "abcd"'d'

Note: Will throw an error exception if index is out of bounds.