optics-core-0.3: Optics as an abstract interface: core definitions

Safe HaskellNone
LanguageHaskell2010

Optics.Internal.Fold

Description

Internal implementation details of folds.

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

foldVL__ :: (Bicontravariant p, Traversing p) => (forall f. Applicative f => (a -> f u) -> s -> f v) -> Optic__ p i i s t a b Source #

Internal implementation of foldVL.

folded__ :: (Bicontravariant p, Traversing p, Foldable f) => Optic__ p i i (f a) (f b) a b Source #

Internal implementation of folded.

foldring__ :: (Bicontravariant p, Traversing p) => (forall f. Applicative f => (a -> f u -> f u) -> f v -> s -> f w) -> Optic__ p i i s t a b Source #

Internal implementation of foldring.

data Leftmost a Source #

Used for headOf and iheadOf.

Constructors

LPure 
LLeaf a 
LStep (Leftmost a) 
Instances
Semigroup (Leftmost a) Source # 
Instance details

Defined in Optics.Internal.Fold

Methods

(<>) :: Leftmost a -> Leftmost a -> Leftmost a #

sconcat :: NonEmpty (Leftmost a) -> Leftmost a #

stimes :: Integral b => b -> Leftmost a -> Leftmost a #

Monoid (Leftmost a) Source # 
Instance details

Defined in Optics.Internal.Fold

Methods

mempty :: Leftmost a #

mappend :: Leftmost a -> Leftmost a -> Leftmost a #

mconcat :: [Leftmost a] -> Leftmost a #

getLeftmost :: Leftmost a -> Maybe a Source #

Extract the Leftmost element. This will fairly eagerly determine that it can return Just the moment it sees any element at all.

data Rightmost a Source #

Used for lastOf and ilastOf.

Constructors

RPure 
RLeaf a 
RStep (Rightmost a) 
Instances
Semigroup (Rightmost a) Source # 
Instance details

Defined in Optics.Internal.Fold

Methods

(<>) :: Rightmost a -> Rightmost a -> Rightmost a #

sconcat :: NonEmpty (Rightmost a) -> Rightmost a #

stimes :: Integral b => b -> Rightmost a -> Rightmost a #

Monoid (Rightmost a) Source # 
Instance details

Defined in Optics.Internal.Fold

getRightmost :: Rightmost a -> Maybe a Source #

Extract the Rightmost element. This will fairly eagerly determine that it can return Just the moment it sees any element at all.