HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

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.

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