Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Optional s t a b = forall (p :: Type -> Type -> Type). IsOptional p => Optic p s t a b
- type Optional' s a = Optional s s a a
- class (IsLens p, IsPrism p) => IsOptional (p :: Type -> Type -> Type)
- optional :: (s -> Either t a) -> (s -> b -> t) -> Optional s t a b
- optional' :: (s -> Maybe a) -> (s -> b -> s) -> Optional s s a b
- matching :: Optional s t a b -> s -> Either t a
- matching' :: Optional s t a b -> s -> Maybe a
- withOptional :: Optional s t a b -> ((s -> Either t a) -> (s -> b -> t) -> r) -> r
- traverseOf :: Functor f => Optional s t a b -> (forall r. r -> f r) -> (a -> f b) -> s -> f t
- is :: Optional s t a b -> s -> Bool
- isn't :: Optional s t a b -> s -> Bool
- newtype UnpackedOptional a b s t = UnpackedOptional {
- withUnpackedOptional :: forall r. ((s -> Either t a) -> (s -> b -> t) -> r) -> r
- unpackedOptional :: (s -> Either t a) -> (s -> b -> t) -> UnpackedOptional a b s t
Optionals
type Optional s t a b = forall (p :: Type -> Type -> Type). IsOptional p => Optic p s t a b Source #
class (IsLens p, IsPrism p) => IsOptional (p :: Type -> Type -> Type) Source #
Instances
Functor f => IsOptional (OptionalStar f) Source # | |
Defined in Fresnel.Optional.Internal | |
Monad m => IsOptional (Kleisli m) Source # | |
Defined in Fresnel.Optional.Internal | |
IsOptional (UnpackedOptional a b) Source # | |
Defined in Fresnel.Optional | |
Monoid r => IsOptional (Forget r :: Type -> Type -> Type) Source # | |
Defined in Fresnel.Optional.Internal | |
Applicative f => IsOptional (Star f) Source # | |
Defined in Fresnel.Optional.Internal | |
IsOptional (->) Source # | |
Defined in Fresnel.Optional.Internal |
Construction
Elimination
withOptional :: Optional s t a b -> ((s -> Either t a) -> (s -> b -> t) -> r) -> r Source #
traverseOf :: Functor f => Optional s t a b -> (forall r. r -> f r) -> (a -> f b) -> s -> f t Source #
Unpacked
newtype UnpackedOptional a b s t Source #
UnpackedOptional | |
|
Instances
unpackedOptional :: (s -> Either t a) -> (s -> b -> t) -> UnpackedOptional a b s t Source #