Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Prism s t a b = forall (p :: Type -> Type -> Type). IsPrism p => Optic p s t a b
- type Prism' s a = Prism s s a a
- class (IsIso p, Choice p) => IsPrism (p :: Type -> Type -> Type)
- prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b
- prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b
- withPrism :: Prism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r
- matching :: Optional s t a b -> s -> Either t a
- matching' :: Optional s t a b -> s -> Maybe a
- is :: Optional s t a b -> s -> Bool
- isn't :: Optional s t a b -> s -> Bool
- only :: Eq a => a -> Prism' a ()
- nearly :: a -> (a -> Bool) -> Prism' a ()
- without :: Prism s1 t1 a1 b1 -> Prism s2 t2 a2 b2 -> Prism (Either s1 s2) (Either t1 t2) (Either a1 a2) (Either b1 b2)
- below :: forall (f :: Type -> Type) s a. Traversable f => Prism' s a -> Prism' (f s) (f a)
- aside :: Prism s t a b -> Prism (e, s) (e, t) (e, a) (e, b)
- newtype UnpackedPrism a b s t = UnpackedPrism {
- withUnpackedPrism :: forall r. ((b -> t) -> (s -> Either t a) -> r) -> r
- unpackedPrism :: (b -> t) -> (s -> Either t a) -> UnpackedPrism a b s t
Prisms
class (IsIso p, Choice p) => IsPrism (p :: Type -> Type -> Type) Source #
Instances
Functor f => IsPrism (OptionalStar f) Source # | |
Defined in Fresnel.Prism.Internal | |
IsPrism (Recall e) Source # | |
Defined in Fresnel.Prism.Internal | |
Monad m => IsPrism (Kleisli m) Source # | |
Defined in Fresnel.Prism.Internal | |
IsPrism (UnpackedOptional a b) Source # | |
Defined in Fresnel.Optional | |
IsPrism (UnpackedPrism a b) Source # | |
Defined in Fresnel.Prism | |
Monoid r => IsPrism (Forget r :: Type -> Type -> Type) Source # | |
Defined in Fresnel.Prism.Internal | |
Applicative f => IsPrism (Star f) Source # | |
Defined in Fresnel.Prism.Internal | |
IsPrism (->) Source # | |
Defined in Fresnel.Prism.Internal |
Construction
Elimination
Relations
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 #
Unpacked
newtype UnpackedPrism a b s t Source #
UnpackedPrism | |
|
Instances
IsIso (UnpackedPrism a b) Source # | |
Defined in Fresnel.Prism | |
IsPrism (UnpackedPrism a b) Source # | |
Defined in Fresnel.Prism | |
Choice (UnpackedPrism a b) Source # | |
Defined in Fresnel.Prism 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 # | |
Defined in Fresnel.Prism 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 # | |
Defined in Fresnel.Prism 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 #