proton-0.0.4
Safe HaskellNone
LanguageHaskell2010

Proton.Prisms

Documentation

type Prism s t a b = forall p. Choice p => p a b -> p s t Source #

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

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

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

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

_Left :: Prism (Either a b) (Either a' b) a a' Source #

_Right :: Prism (Either a b) (Either a b') b b' Source #

withPrism :: forall s t a b r. Prism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r Source #

matching :: Prism s t a b -> s -> Either t a Source #