lens-3.8.0.2: Lenses, Folds and Traversals

Portabilitynon-portable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Control.Lens.Internal.Fold

Contents

Description

 

Synopsis

Monoids for folding

newtype Folding f a Source

Constructors

Folding 

Fields

getFolding :: f a
 

Instances

(Gettable f, Applicative f) => Monoid (Folding f a) 
(Gettable f, Apply f) => Semigroup (Folding f a) 

newtype Traversed a f Source

Used internally by traverseOf_ and the like.

The argument a of the result should not be used!

Constructors

Traversed 

Fields

getTraversed :: f a
 

Instances

newtype Sequenced a m Source

Used internally by mapM_ and the like.

The argument a of the result should not be used!

Constructors

Sequenced 

Fields

getSequenced :: m a
 

Instances

Monad m => Monoid (Sequenced a m) 
Apply m => Semigroup (Sequenced a m) 

data Max a Source

Used for maximumOf.

Constructors

NoMax 
Max a 

Instances

Ord a => Monoid (Max a) 
Ord a => Semigroup (Max a) 

getMax :: Max a -> Maybe aSource

Obtain the maximum.

data Min a Source

Used for minimumOf.

Constructors

NoMin 
Min a 

Instances

Ord a => Monoid (Min a) 
Ord a => Semigroup (Min a) 

getMin :: Min a -> Maybe aSource

Obtain the minimum.

data Leftmost a Source

Used for preview.

Constructors

LPure 
LLeaf a 
LStep (Leftmost a) 

Instances

getLeftmost :: Leftmost a -> Maybe aSource

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.

Constructors

RPure 
RLeaf a 
RStep (Rightmost a) 

Instances

getRightmost :: Rightmost a -> Maybe aSource

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