fresnel-0.1.0.0: high-powered optics in a small package
Safe HaskellNone
LanguageHaskell2010

Fresnel.Prism

Synopsis

Prisms

type Prism s t a b = forall (p :: Type -> Type -> Type). IsPrism p => Optic p s t a b Source #

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

class (IsIso p, Choice p) => IsPrism (p :: Type -> Type -> Type) Source #

Instances

Instances details
Functor f => IsPrism (OptionalStar f) Source # 
Instance details

Defined in Fresnel.Prism.Internal

IsPrism (Recall e) Source # 
Instance details

Defined in Fresnel.Prism.Internal

Monad m => IsPrism (Kleisli m) Source # 
Instance details

Defined in Fresnel.Prism.Internal

IsPrism (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

IsPrism (UnpackedPrism a b) Source # 
Instance details

Defined in Fresnel.Prism

Monoid r => IsPrism (Forget r :: Type -> Type -> Type) Source # 
Instance details

Defined in Fresnel.Prism.Internal

Applicative f => IsPrism (Star f) Source # 
Instance details

Defined in Fresnel.Prism.Internal

IsPrism (->) Source # 
Instance details

Defined in Fresnel.Prism.Internal

Construction

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 #

Elimination

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

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

matching' :: Optional s t a b -> s -> Maybe a Source #

is :: Optional s t a b -> s -> Bool Source #

isn't :: Optional s t a b -> s -> Bool Source #

Relations

only :: Eq a => a -> Prism' a () Source #

nearly :: a -> (a -> Bool) -> Prism' a () Source #

Combinators

without :: Prism s1 t1 a1 b1 -> Prism s2 t2 a2 b2 -> Prism (Either s1 s2) (Either t1 t2) (Either a1 a2) (Either b1 b2) Source #

below :: forall (f :: Type -> Type) s a. Traversable f => Prism' s a -> Prism' (f s) (f a) Source #

aside :: Prism s t a b -> Prism (e, s) (e, t) (e, a) (e, b) Source #

Unpacked

newtype UnpackedPrism a b s t Source #

Constructors

UnpackedPrism 

Fields

Instances

Instances details
IsIso (UnpackedPrism a b) Source # 
Instance details

Defined in Fresnel.Prism

IsPrism (UnpackedPrism a b) Source # 
Instance details

Defined in Fresnel.Prism

Choice (UnpackedPrism a b) Source # 
Instance details

Defined in Fresnel.Prism

Methods

left' :: UnpackedPrism a b a0 b0 -> UnpackedPrism a b (Either a0 c) (Either b0 c) #

right' :: UnpackedPrism a b a0 b0 -> UnpackedPrism a b (Either c a0) (Either c b0) #

Profunctor (UnpackedPrism a b) Source # 
Instance details

Defined in Fresnel.Prism

Methods

dimap :: (a0 -> b0) -> (c -> d) -> UnpackedPrism a b b0 c -> UnpackedPrism a b a0 d #

lmap :: (a0 -> b0) -> UnpackedPrism a b b0 c -> UnpackedPrism a b a0 c #

rmap :: (b0 -> c) -> UnpackedPrism a b a0 b0 -> UnpackedPrism a b a0 c #

(#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> UnpackedPrism a b a0 b0 -> UnpackedPrism a b a0 c #

(.#) :: forall a0 b0 c q. Coercible b0 a0 => UnpackedPrism a b b0 c -> q a0 b0 -> UnpackedPrism a b a0 c #

Functor (UnpackedPrism a b s) Source # 
Instance details

Defined in Fresnel.Prism

Methods

fmap :: (a0 -> b0) -> UnpackedPrism a b s a0 -> UnpackedPrism a b s b0 #

(<$) :: a0 -> UnpackedPrism a b s b0 -> UnpackedPrism a b s a0 #

unpackedPrism :: (b -> t) -> (s -> Either t a) -> UnpackedPrism a b s t Source #