monad-ox-0.3.0: Monad for observation extraction

Safe HaskellSafe-Inferred

Control.Monad.Ox.String

Description

Popular transformation functions for the String observation type.

Synopsis

Documentation

prefix :: Int -> String -> Maybe StringSource

Prefix of the given size or Nothing if the size exceeds the length of the string.

suffix :: Int -> String -> Maybe StringSource

Suffix of the given size or Nothing if the size exceeds the length of the string.

substr :: Int -> String -> [String]Source

All substrings of the given size.

shape :: String -> StringSource

Shape of the string. All lower-case characters are mapped to l, upper-case characters to u, digits to d and rest of characters to x.

pack :: String -> StringSource

Pack the string, that is remove all adjacent repetitions, for example aabcccdde -> abcde.