Proton.Prisms
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 #
_Nothing :: Prism' (Maybe a) () Source #
_Left :: Prism (Either a b) (Either a' b) a a' Source #
_Right :: Prism (Either a b) (Either a b') b b' Source #
_Show :: (Read a, Show a) => Prism' String a 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 #