smash-lens-0.1.0.3: Optics for the `smash` library
Copyright(c) 2020-2022 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityFlexibleInstances, MPTC, Type Families, UndecideableInstances
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Wedge.Lens

Description

Prisms and Traversals for the Wedge datatype.

Synopsis

Isos

_WedgeIso :: Iso (Wedge a b) (Wedge c d) (Maybe (Either a b)) (Maybe (Either c d)) Source #

A Iso between a wedge sum and pointed coproduct.

Traversals

here :: Traversal' (Wedge a b) a Source #

A Traversal of the Here case of a Wedge, suitable for use with Control.Lens.

>>> over here show (Here 1)
Here "1"
>>> over here show (There 'a')
There 'a'

there :: Traversal' (Wedge a b) b Source #

A Traversal of the There case of a Wedge, suitable for use with Control.Lens.

>>> over there show (Here 1)
Here 1
>>> over there show (There 'a')
There "'a'"

Prisms

_Nowhere :: Prism' (Wedge a b) () Source #

A Prism' selecting the Nowhere constructor.

Note: cannot change type.

_Here :: Prism (Wedge a b) (Wedge c b) a c Source #

A Prism' selecting the Here constructor.

Note: cannot change type.

_There :: Prism (Wedge a b) (Wedge a d) b d Source #

A Prism' selecting the There constructor.

Note: cannot change type.

Orphan instances

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

Methods

each :: Traversal (Wedge a a') (Wedge b b') a b #