smash-optics-0.1.0.2: Optics for the `smash` library using `optics-core`
Copyright(c) 2020-2022 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityFlexibleInstances, MPTC, Type Families, UndecideableInstances
Safe HaskellNone
LanguageHaskell2010

Data.Wedge.Optics

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 :: AffineTraversal (Wedge a b) (Wedge a' b) a a' Source #

An AffineTraversal of the Here case of a Wedge, suitable for use with Optics.

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

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

An AffineTraversal of the There case of a Wedge, suitable for use with Optics.

>>> 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: this optic cannot change type.

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

A Prism' selecting the Here constructor.

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

A Prism' selecting the There constructor.

Orphan instances

Swapped Wedge Source # 
Instance details

Methods

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

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

Methods

each :: IxTraversal Bool (Wedge a a') (Wedge b b') a b #