fresnel-0.0.0.3: high-powered optics in a small package
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fresnel.Fold

Synopsis

Folds

type Fold s a = forall p. IsFold p => Optic' p s a Source #

class (IsOptionalFold p, IsTraversal p) => IsFold p Source #

Instances

Instances details
Monoid r => IsFold (Forget r :: Type -> Type -> Type) Source # 
Instance details

Defined in Fresnel.Fold

(Applicative f, Traversable f, Contravariant f) => IsFold (Star f) Source # 
Instance details

Defined in Fresnel.Fold

Construction

folded :: Foldable f => Fold (f a) a Source #

unfolded :: (s -> Maybe (a, s)) -> Fold s a Source #

folding :: Foldable f => (s -> f a) -> Fold s a Source #

foldring :: (forall f. Applicative f => (a -> f u -> f u) -> f v -> s -> f w) -> Fold s a Source #

backwards :: Fold s a -> Fold s a Source #

Elimination

has :: Fold s a -> s -> Bool Source #

hasn't :: Fold s a -> s -> Bool Source #

foldMapOf :: Monoid m => Fold s a -> (a -> m) -> s -> m Source #

foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r Source #

foldrOf :: Fold s a -> (a -> r -> r) -> r -> s -> r Source #

foldlOf' :: Fold s a -> (r -> a -> r) -> r -> s -> r Source #

foldOf :: Monoid a => Fold s a -> s -> a 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 #

toListOf :: Fold s a -> s -> [a] Source #

anyOf :: Fold s a -> (a -> Bool) -> s -> Bool Source #

allOf :: Fold s a -> (a -> Bool) -> s -> Bool Source #

nullOf :: Fold s a -> s -> Bool Source #

previews :: Fold s a -> (a -> r) -> s -> Maybe r Source #

preview :: Fold s a -> s -> Maybe a Source #

(^?) :: s -> Fold s a -> Maybe a infixl 8 Source #

newtype Failover s a Source #

Constructors

Failover 

Fields

Instances

Instances details
Monoid (Failover s a) Source # 
Instance details

Defined in Fresnel.Fold

Methods

mempty :: Failover s a #

mappend :: Failover s a -> Failover s a -> Failover s a #

mconcat :: [Failover s a] -> Failover s a #

Semigroup (Failover s a) Source # 
Instance details

Defined in Fresnel.Fold

Methods

(<>) :: Failover s a -> Failover s a -> Failover s a #

sconcat :: NonEmpty (Failover s a) -> Failover s a #

stimes :: Integral b => b -> Failover s a -> Failover s a #

newtype Union s a Source #

Constructors

Union 

Fields

Instances

Instances details
Monoid (Union s a) Source # 
Instance details

Defined in Fresnel.Fold

Methods

mempty :: Union s a #

mappend :: Union s a -> Union s a -> Union s a #

mconcat :: [Union s a] -> Union s a #

Semigroup (Union s a) Source # 
Instance details

Defined in Fresnel.Fold

Methods

(<>) :: Union s a -> Union s a -> Union s a #

sconcat :: NonEmpty (Union s a) -> Union s a #

stimes :: Integral b => b -> Union s a -> Union s a #