servant-checked-exceptions-1.1.0.0: Checked exceptions for Servant APIs.

LicenseBSD3
MaintainerDennis Gosnell (cdep.illabout@gmail.com)
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Servant.Checked.Exceptions.Internal.Prism

Description

These functions are for working with Optics popularized by the lens package. Documentation can be found in the lens package. These functions are redefined here to remove the dependency on the lens package.

Documentation

type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t) Source #

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b Source #

type Prism' s a = Prism s s a a Source #

prism' :: (a -> s) -> (s -> Maybe a) -> Prism' s a Source #

type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t) Source #

iso :: (s -> a) -> (b -> t) -> Iso s t a b Source #

review :: Prism' t b -> b -> t Source #

preview :: Prism' s a -> s -> Maybe a Source #

(<>~) :: Monoid a => ASetter s t a a -> a -> s -> t infixr 4 Source #