a -> (a -> Bool) -> Maybe a
The find function takes a predicate and a list and returns the first element in the list matching the predicate, or Nothing if there is no such element.
The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.
Tries to generate a value that satisfies a predicate.
Direct MonadPlus equivalent of filter filter = (mfilter:: (a -> Bool) -> [a] -> [a] applicable to any MonadPlus, for example mfilter odd (Just 1) == Just 1 mfilter odd (Just 2) == Nothing
until p f yields the result of applying f until p holds.
The findIndex function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or Nothing if there is no such element.
findIndexL p xs finds the index of the leftmost element that satisfies p, if any exist.
findIndexR p xs finds the index of the rightmost element that satisfies p, if any exist.
Apply a transformation everywhere in bottom-up manner
Apply a transformation everywhere in top-down manner
Application operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
> f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as map ($ 0) xs, or Data.List.zipWith ($) fs xs.
Strict (call-by-value) application, defined in terms of seq.
Determines whether all elements of the structure satisfy the predicate.
Determines whether any element of the structure satisfies the predicate.
Applied to a predicate and a list, all determines if all elements of the list satisfy the predicate. For the result to be True, the list must be finite; False, however, results from a False value for the predicate applied to an element at a finite index of a finite or infinite list.
Applied to a predicate and a list, any determines if any element of the list satisfies the predicate. For the result to be False, the list must be finite; True, however, results from a True value for the predicate applied to an element at a finite index of a finite or infinite list.
The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.
Extend a generic transformation by a type-specific case
An infix synonym for fmap.
Show more results