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

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

Moduletext-short-0.1.6.1Haskell2010

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
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.