optics-core-0.4.1.1: Optics as an abstract interface: core definitions

Safe Haskell | None
Language | Haskell2010

Data.Maybe.Optics

Description

This module defines `Prism`s for the constructors of the `Maybe` datatype.

Synopsis

- _Nothing :: Prism' (Maybe a) ()
- _Just :: Prism (Maybe a) (Maybe b) a b
- (%?) :: forall (is :: IxList) (js :: IxList) (ks :: IxList) k k' l m s t u v a b. (AppendIndices is js ks, JoinKinds k A_Prism k', JoinKinds k' l m) => Optic k is s t (Maybe u) (Maybe v) -> Optic l js u v a b -> Optic m ks s t a b

# Documentation

_Nothing :: Prism' (Maybe a) () Source #

A `Prism` that matches on the `Nothing` constructor of `Maybe`.

_Just :: Prism (Maybe a) (Maybe b) a b Source #

A `Prism` that matches on the `Just` constructor of `Maybe`.

(%?) :: forall (is :: IxList) (js :: IxList) (ks :: IxList) k k' l m s t u v a b. (AppendIndices is js ks, JoinKinds k A_Prism k', JoinKinds k' l m) => Optic k is s t (Maybe u) (Maybe v) -> Optic l js u v a b -> Optic m ks s t a b infixl 9 Source #

Shortcut for ``%` `_Just` `%``.

Useful for composing lenses of `Maybe` type.

Since: 0.4.1