FunctorFilter
public protocol FunctorFilter : Functor
A FunctorFilter provides the same capabilities as a Functor, while filtering out elements simultaneously.
-
Maps the value/s in the context implementing this instance, filtering out the ones resulting in
Option.none.Declaration
Parameters
faA value in the context implementing this instance.
fA function to map objects and filter them out.
Return Value
Transformed and filtered values, in the context implementing this instance.
-
flattenOption(_:)Extension methodRemoves the
Option.nonevalue/s in this context and extracts theOption.someones.Parameters
faOptional values in the context implementing this instance.
Return Value
Plain values in the context implementing this instance.
-
filter(_:_:)Extension methodFilters out the value/s in the context implementing this instance that do not match the given predicate.
Declaration
Parameters
faValue in the context implementing this instance.
fFiltering predicate.
Return Value
Filtered value in the context implementing this instance.
Install in Dash
FunctorFilter Protocol Reference