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

Data.Smash.Lens

Description

Prisms and Traversals for the Smash datatype.

Synopsis
  • _Nada :: Prism' (Smash a b) ()
  • _Smash :: Prism' (Smash a b) (a, b)
  • smashed :: Traversal (Smash a b) (Smash c d) (a, b) (c, d)
  • smashing :: Traversal (Smash a a) (Smash b b) a b

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 show (Smash 1 2)
"(1,2)"
>>> over smashed show 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

Swapped Smash Source # 
Instance details

Methods

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

(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