strict-optics-0.4: Optics for types in strict package

Safe HaskellNone
LanguageHaskell2010

Data.Strict.Optics

Contents

Synopsis

Tuple

See instances, in particular for Field1 and Field2 type classes. * Either

_Left :: Prism (Either a c) (Either b c) a b Source #

Analogous to _Left in Control.Lens.Prism.

_Right :: Prism (Either c a) (Either c b) a b Source #

Analogous to _Right in Control.Lens.Prism.

Maybe

_Just :: Prism (Maybe a) (Maybe b) a b Source #

Analogous to _Just in Control.Lens.Prism

These

here :: Traversal (These a c) (These b c) a b Source #

A Traversal of the first half of a These, suitable for use with Control.Lens.

>>> over here show (That 1)
That 1
>>> over here show (These 'a' 2)
These "'a'" 2

there :: Traversal (These c a) (These c b) a b Source #

A Traversal of the second half of a These, suitable for use with Control.Lens.

there :: Traversal (These t b) (These t b) a b
>>> over there show (That 1)
That "1"
>>> over there show (These 'a' 2)
These 'a' "2"

_This :: Prism' (These a b) a Source #

A Prism' selecting the This constructor.

Note: cannot change type.

_That :: Prism' (These a b) b Source #

A Prism' selecting the That constructor.

Note: cannot change type.

_These :: Prism' (These a b) (a, b) Source #

A Prism' selecting the These constructor. These names are ridiculous!

Note: cannot change type.

Combinators

strict :: Strict lazy strict => Iso' lazy strict Source #

Ad hoc conversion between "strict" and "lazy" versions of a structure, using Strict class.

lazy :: Strict lazy strict => Iso' strict lazy Source #

An Iso' between the strict variant of a structure and its lazy counterpart.

lazy = re strict

Orphan instances

Swapped Pair Source # 
Instance details

Methods

swapped :: Iso (Pair a b) (Pair c d) (Pair b a) (Pair d c) #

Swapped These Source # 
Instance details

Methods

swapped :: Iso (These a b) (These c d) (These b a) (These d c) #

Swapped Either Source # 
Instance details

Methods

swapped :: Iso (Either a b) (Either c d) (Either b a) (Either d c) #

Each () (Maybe a) (Maybe b) a b Source # 
Instance details

Methods

each :: IxTraversal () (Maybe a) (Maybe b) a b #

(a ~ a', b ~ b') => Each Int (Pair a a') (Pair b b') a b Source # 
Instance details

Methods

each :: IxTraversal Int (Pair a a') (Pair b b') a b #

Field1 (Pair a b) (Pair a' b) a a' Source # 
Instance details

Methods

_1 :: Lens (Pair a b) (Pair a' b) a a' #

Field2 (Pair a b) (Pair a b') b b' Source # 
Instance details

Methods

_2 :: Lens (Pair a b) (Pair a b') b b' #

(a ~ a', b ~ b') => Each (Either () ()) (These a a') (These b b') a b Source # 
Instance details

Methods

each :: IxTraversal (Either () ()) (These a a') (These b b') a b #

(a ~ a', b ~ b') => Each (Either () ()) (Either a a') (Either b b') a b Source # 
Instance details

Methods

each :: IxTraversal (Either () ()) (Either a a') (Either b b') a b #