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.Smash.Lens

Description

Prisms and Traversals for the Smash datatype.

Synopsis

Isos

_SmashIso :: Iso (Smash a b) (Smash c d) (Maybe (a, b)) (Maybe (c, d)) Source #

A Iso between a smash product and pointed tuple.

Prisms

_Nada :: Prism' (Smash a b) () Source #

A Prism' selecting the Nada constructor.

Note: cannot change type.

_Smash :: Prism' (Smash a b) (a, b) Source #

A Prism' selecting the Smash constructor.

Note: cannot change type.

Traversals

smashed :: Traversal (Smash a b) (Smash c d) (a, b) (c, d) Source #

A Traversal of the smashed pair, suitable for use with Control.Lens.

>>> over smashed (fmap pred) (Smash 1 2)
Smash 1 1
>>> over smashed id Nada
Nada

smashing :: Traversal (Smash a a) (Smash b b) a b Source #

A Traversal of the smashed pair, suitable for use with Control.Lens.

>>> over smashing show (Smash 1 2)
Smash "1" "2"
>>> over smashing show Nada
Nada

Orphan instances

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

Methods

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