smash-optics-0.1.0.0: Optics for the `smash` library using `optics-core`

Copyright(c) 2020 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityFlexibleInstances, MPTC, Type Families, UndecideableInstances
Safe HaskellNone
LanguageHaskell2010

Data.Smash.Optics

Contents

Description

Prisms and Traversals for the Smash datatype.

Synopsis

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.

>>> over smashed show (Smash 1 2)
"(1,2)"
>>> over smashed show Nada
Nada

smashing :: IxTraversal (Maybe Bool) (Smash a a) (Smash b b) a b Source #

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

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

Orphan instances

Swapped Smash Source # 

Methods

swapped :: Iso (Smash a b) (Smash c d) (Smash b a) (Smash d c)

((~) * a a', (~) * b b') => Each (Maybe Bool) (Smash a a') (Smash b b') a b Source # 

Methods

each :: IxTraversal (Maybe Bool) (Smash a a') (Smash b b') a b