fresnel-0.0.0.3: high-powered optics in a small package
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fresnel.Optional

Synopsis

Optionals

type Optional s t a b = forall p. IsOptional p => Optic p s t a b Source #

type Optional' s a = Optional s s a a Source #

class (IsLens p, IsPrism p) => IsOptional p Source #

Instances

Instances details
Monad m => IsOptional (Kleisli m) Source # 
Instance details

Defined in Fresnel.Optional.Internal

Functor f => IsOptional (OptionalStar f) Source # 
Instance details

Defined in Fresnel.Optional.Internal

IsOptional (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

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

Defined in Fresnel.Optional.Internal

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

Defined in Fresnel.Optional.Internal

IsOptional (->) Source # 
Instance details

Defined in Fresnel.Optional.Internal

Construction

optional :: (s -> Either t a) -> (s -> b -> t) -> Optional s t a b Source #

optional' :: (s -> Maybe a) -> (s -> b -> s) -> Optional s s a b Source #

Elimination

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

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

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 #

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

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

Unpacked

newtype UnpackedOptional a b s t Source #

Constructors

UnpackedOptional 

Fields

Instances

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

Defined in Fresnel.Optional

IsLens (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

IsOptional (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

IsPrism (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

Choice (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

Methods

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

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

Strong (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

Methods

first' :: UnpackedOptional a b a0 b0 -> UnpackedOptional a b (a0, c) (b0, c) #

second' :: UnpackedOptional a b a0 b0 -> UnpackedOptional a b (c, a0) (c, b0) #

Profunctor (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

Methods

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

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

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

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

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

unpackedOptional :: (s -> Either t a) -> (s -> b -> t) -> UnpackedOptional a b s t Source #