module Fresnel.Either
( -- * Prisms
  _Left
, _Right
) where

import Fresnel.Prism

-- Prisms

_Left :: Prism (Either a b) (Either a' b) a a'
_Left :: forall a b a' (p :: * -> * -> *).
IsPrism p =>
Optic p (Either a b) (Either a' b) a a'
_Left = (a' -> Either a' b)
-> (Either a b -> Either (Either a' b) a)
-> Prism (Either a b) (Either a' b) a a'
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism a' -> Either a' b
forall a b. a -> Either a b
Left ((a -> Either (Either a' b) a)
-> (b -> Either (Either a' b) a)
-> Either a b
-> Either (Either a' b) a
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either a -> Either (Either a' b) a
forall a b. b -> Either a b
Right (Either a' b -> Either (Either a' b) a
forall a b. a -> Either a b
Left (Either a' b -> Either (Either a' b) a)
-> (b -> Either a' b) -> b -> Either (Either a' b) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Either a' b
forall a b. b -> Either a b
Right))

_Right :: Prism (Either a b) (Either a b') b b'
_Right :: forall a b b' (p :: * -> * -> *).
IsPrism p =>
Optic p (Either a b) (Either a b') b b'
_Right = (b' -> Either a b')
-> (Either a b -> Either (Either a b') b)
-> Prism (Either a b) (Either a b') b b'
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism b' -> Either a b'
forall a b. b -> Either a b
Right ((a -> Either (Either a b') b)
-> (b -> Either (Either a b') b)
-> Either a b
-> Either (Either a b') b
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (Either a b' -> Either (Either a b') b
forall a b. a -> Either a b
Left (Either a b' -> Either (Either a b') b)
-> (a -> Either a b') -> a -> Either (Either a b') b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Either a b'
forall a b. a -> Either a b
Left) b -> Either (Either a b') b
forall a b. b -> Either a b
Right)