Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Folds for text streams
- fold :: Fold Text a -> Text -> a
- head :: Fold Text (Maybe Char)
- last :: Fold Text (Maybe Char)
- null :: Fold Text Bool
- length :: Num n => Fold Text n
- any :: (Char -> Bool) -> Fold Text Bool
- all :: (Char -> Bool) -> Fold Text Bool
- maximum :: Fold Text (Maybe Char)
- minimum :: Fold Text (Maybe Char)
- elem :: Char -> Fold Text Bool
- notElem :: Char -> Fold Text Bool
- find :: (Char -> Bool) -> Fold Text (Maybe Char)
- index :: Integral n => n -> Fold Text (Maybe Char)
- elemIndex :: Num n => Char -> Fold Text (Maybe n)
- findIndex :: Num n => (Char -> Bool) -> Fold Text (Maybe n)
- count :: Num n => Char -> Fold Text n
- module Control.Foldl
- module Data.Text
Folding
Folds
head :: Fold Text (Maybe Char) Source
Get the first character of a text stream or return Nothing
if the stream
is empty
last :: Fold Text (Maybe Char) Source
Get the last character of a text stream or return Nothing
if the text
stream is empty
find :: (Char -> Bool) -> Fold Text (Maybe Char) Source
(find predicate)
returns the first character that satisfies the predicate
or Nothing
if no character satisfies the predicate
index :: Integral n => n -> Fold Text (Maybe Char) Source
(index n)
returns the n
th character of the text stream, or Nothing
if
the stream has an insufficient number of characters
elemIndex :: Num n => Char -> Fold Text (Maybe n) Source
(elemIndex c)
returns the index of the first character that equals c
,
or Nothing
if no character matches
findIndex :: Num n => (Char -> Bool) -> Fold Text (Maybe n) Source
(findIndex predicate)
returns the index of the first character that
satisfies the predicate, or Nothing
if no character satisfies the
predicate
Re-exports
Control.Foldl re-exports the Fold
type
Data.Text
re-exports the Text
type
module Control.Foldl
module Data.Text