lens-2.1: Lenses, Folds and Traversals

PortabilityRank2Types
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

Data.Monoid.Lens

Description

 

Synopsis

Documentation

_dual :: Iso a b (Dual a) (Dual b)Source

Isomorphism for Dual

_endo :: Iso (a -> a) (b -> b) (Endo a) (Endo b)Source

Isomorphism for Endo

_all :: Simple Iso Bool AllSource

Isomorphism for All

>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _all foldMap [True,True]
True
>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _all foldMap [True,False]
False

_any :: Simple Iso Bool AnySource

Isomorphism for Any

>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _any foldMap [False,False]
False
>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _any foldMap [True,False]
True

_sum :: Iso a b (Sum a) (Sum b)Source

Isomorphism for Sum

>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _sum foldMap [1,2,3,4]
10

_product :: Iso a b (Product a) (Product b)Source

Isomorphism for Product

>>> :m + Control.Lens Data.Monoid.Lens Data.Foldable
>>> au _product foldMap [1,2,3,4]
24

_first :: Iso (Maybe a) (Maybe b) (First a) (First b)Source

Isomorphism for First

_last :: Iso (Maybe a) (Maybe b) (Last a) (Last b)Source

Isomorphism for Last