Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Fold s a = forall (p :: Type -> Type -> Type). IsFold p => Optic' p s a
- class (IsOptionalFold p, IsFold1 p, IsTraversal p) => IsFold (p :: Type -> Type -> Type)
- folded :: forall (f :: Type -> Type) a. Foldable f => Fold (f a) a
- unfolded :: (s -> Maybe (a, s)) -> Fold s a
- folding :: Foldable f => (s -> f a) -> Fold s a
- foldring :: (forall (f :: Type -> Type). Applicative f => (a -> f u -> f u) -> f v -> s -> f w) -> Fold s a
- foldMapping :: (forall m. Monoid m => (a -> m) -> s -> m) -> Fold s a
- foldMap1ing :: (forall m. Semigroup m => (a -> m) -> s -> m) -> Fold s a
- ignored :: forall s a b p. IsTraversal p => Optic p s s a b
- backwards :: Fold s a -> Fold s a
- iterated :: (a -> a) -> Fold a a
- filtered :: (a -> Bool) -> Fold a a
- repeated :: forall a p. IsFold p => Optic' p a a
- replicated :: Int -> Fold a a
- cycled :: Fold s a -> Fold s a
- takingWhile :: (a -> Bool) -> Fold s a -> Fold s a
- has :: Fold s a -> s -> Bool
- hasn't :: Fold s a -> s -> Bool
- foldMapOf :: Monoid m => Fold s a -> (a -> m) -> s -> m
- foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
- foldrOf :: Fold s a -> (a -> r -> r) -> r -> s -> r
- foldlOf' :: Fold s a -> (r -> a -> r) -> r -> s -> r
- foldOf :: Monoid a => Fold s a -> s -> a
- foldByOf :: Fold s a -> (a -> a -> a) -> a -> s -> a
- sequenceOf_ :: Applicative f => Fold s (f a) -> s -> f ()
- traverseOf_ :: Applicative f => Fold s a -> (a -> f r) -> s -> f ()
- forOf_ :: Applicative f => Fold s a -> s -> (a -> f r) -> f ()
- toListOf :: Fold s a -> s -> [a]
- anyOf :: Fold s a -> (a -> Bool) -> s -> Bool
- allOf :: Fold s a -> (a -> Bool) -> s -> Bool
- noneOf :: Fold s a -> (a -> Bool) -> s -> Bool
- andOf :: Fold s Bool -> s -> Bool
- orOf :: Fold s Bool -> s -> Bool
- productOf :: Num a => Fold s a -> s -> a
- sumOf :: Num a => Fold s a -> s -> a
- altOf :: Alternative f => Fold s a -> s -> f a
- asumOf :: Alternative f => Fold s (f a) -> s -> f a
- concatOf :: Fold s [a] -> s -> [a]
- concatMapOf :: Fold s a -> (a -> [r]) -> s -> [r]
- elemOf :: Eq a => Fold s a -> a -> s -> Bool
- notElemOf :: Eq a => Fold s a -> a -> s -> Bool
- lengthOf :: Fold s a -> s -> Int
- nullOf :: Fold s a -> s -> Bool
- notNullOf :: Fold s a -> s -> Bool
- firstOf :: Fold s a -> s -> Maybe a
- lastOf :: Fold s a -> s -> Maybe a
- minimumOf :: Ord a => Fold s a -> s -> Maybe a
- minimumByOf :: Fold s a -> (a -> a -> Ordering) -> s -> Maybe a
- maximumOf :: Ord a => Fold s a -> s -> Maybe a
- maximumByOf :: Fold s a -> (a -> a -> Ordering) -> s -> Maybe a
- findOf :: Fold s a -> (a -> Bool) -> s -> Maybe a
- findMOf :: Monad m => Fold s a -> (a -> m Bool) -> s -> m (Maybe a)
- lookupOf :: Eq k => Fold s (k, v) -> k -> s -> Maybe v
- previews :: Fold s a -> (a -> r) -> s -> Maybe r
- preview :: Fold s a -> s -> Maybe a
- (^?) :: s -> Fold s a -> Maybe a
- newtype Failover s a = Failover {
- getFailover :: Fold s a
- newtype Union s a = Union {}
Folds
class (IsOptionalFold p, IsFold1 p, IsTraversal p) => IsFold (p :: Type -> Type -> Type) Source #
Instances
Monoid r => IsFold (Forget r :: Type -> Type -> Type) Source # | |
Defined in Fresnel.Fold | |
(Applicative f, Traversable f, Contravariant f) => IsFold (Star f) Source # | |
Defined in Fresnel.Fold |
Construction
foldring :: (forall (f :: Type -> Type). Applicative f => (a -> f u -> f u) -> f v -> s -> f w) -> Fold s a Source #
foldMapping :: (forall m. Monoid m => (a -> m) -> s -> m) -> Fold s a Source #
Make a Fold
by lifting a foldMap
-like function.
foldMapping
foldMap
=folded
foldMap1ing :: (forall m. Semigroup m => (a -> m) -> s -> m) -> Fold s a Source #
Make a Fold
by lifting a foldMap1
-like function.
ignored :: forall s a b p. IsTraversal p => Optic p s s a b Source #
The trivially empty
.Traversal
traverseOf
ignored
f = pure
replicated :: Int -> Fold a a Source #
A fold producing its input a finite number of times.
toListOf
(replicated
n) a =replicate
n a
Elimination
foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r Source #
sequenceOf_ :: Applicative f => Fold s (f a) -> s -> f () Source #
traverseOf_ :: Applicative f => Fold s a -> (a -> f r) -> s -> f () Source #
forOf_ :: Applicative f => Fold s a -> s -> (a -> f r) -> f () Source #
altOf :: Alternative f => Fold s a -> s -> f a Source #
asumOf :: Alternative f => Fold s (f a) -> s -> f a Source #
concatMapOf :: Fold s a -> (a -> [r]) -> s -> [r] Source #
Failover | |
|