Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Folds of other types trivially lifted into Fold
Synopsis
- null :: Fold a Bool
- magma :: (a -> a -> a) -> Fold a (Maybe a)
- semigroup :: Semigroup a => Fold a (Maybe a)
- first :: Fold a (Maybe a)
- last :: Fold a (Maybe a)
- maximum :: Ord a => Fold a (Maybe a)
- minimum :: Ord a => Fold a (Maybe a)
- maximumBy :: (a -> a -> Ordering) -> Fold a (Maybe a)
- minimumBy :: (a -> a -> Ordering) -> Fold a (Maybe a)
- and :: Fold Bool Bool
- or :: Fold Bool Bool
- all :: (a -> Bool) -> Fold a Bool
- any :: (a -> Bool) -> Fold a Bool
- element :: Eq a => a -> Fold a Bool
- notElement :: Eq a => a -> Fold a Bool
- find :: (a -> Bool) -> Fold a (Maybe a)
- lookup :: Eq a => a -> Fold (a, b) (Maybe b)
- index :: Natural -> Fold a (Maybe a)
- findIndex :: (a -> Bool) -> Fold a (Maybe Natural)
- elementIndex :: Eq a => a -> Fold a (Maybe Natural)
Length
General
magma :: (a -> a -> a) -> Fold a (Maybe a) Source #
Start with the first input, append each new input on the right with the given function
Endpoints
Extrema
maximumBy :: (a -> a -> Ordering) -> Fold a (Maybe a) Source #
The greatest input with respect to the given comparison function
minimumBy :: (a -> a -> Ordering) -> Fold a (Maybe a) Source #
The least input with respect to the given comparison function
Boolean
Search
find :: (a -> Bool) -> Fold a (Maybe a) Source #
The first input that satisfies the predicate, if any
lookup :: Eq a => a -> Fold (a, b) (Maybe b) Source #
The b
from the first tuple where a
equals the given value, if any
Index
index :: Natural -> Fold a (Maybe a) Source #
The nth input, where n=0 is the first input, if the index is in bounds