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

Fresnel.Lens

Synopsis

Lenses

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

type Lens' s a = Lens s s a a Source #

class (IsIso p, Strong p) => IsLens (p :: Type -> Type -> Type) Source #

Instances

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

Defined in Fresnel.Lens.Internal

Functor f => IsLens (Star1 f) Source # 
Instance details

Defined in Fresnel.Lens.Internal

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

Defined in Fresnel.Lens.Internal

IsLens (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

IsLens (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

IsLens (Forget r :: Type -> Type -> Type) Source # 
Instance details

Defined in Fresnel.Lens.Internal

Functor f => IsLens (Star f) Source # 
Instance details

Defined in Fresnel.Lens.Internal

IsLens (->) Source # 
Instance details

Defined in Fresnel.Lens.Internal

Construction

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source #

Elimination

withLens :: Lens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r Source #

Combinators

choosing :: Lens s1 t1 a b -> Lens s2 t2 a b -> Lens (Either s1 s2) (Either t1 t2) a b Source #

chosen :: forall a b p. IsLens p => Optic p (Either a a) (Either b b) a b Source #

alongside :: Lens s1 t1 a1 b1 -> Lens s2 t2 a2 b2 -> Lens (s1, s2) (t1, t2) (a1, a2) (b1, b2) Source #

inside :: forall (p :: Type -> Type -> Type) s t a b e. Corepresentable p => Lens s t a b -> Lens (p e s) (p e t) (p e a) (p e b) Source #

devoid :: forall a b p. IsLens p => Optic p Void Void a b Source #

united :: forall a p. IsLens p => Optic p a a () () Source #

Unpacked

newtype UnpackedLens a b s t Source #

A Lens unpacked into the get & set functions it was constructed from.

Constructors

UnpackedLens 

Fields

Instances

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

Defined in Fresnel.Lens

IsLens (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

Strong (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

Methods

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

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

Profunctor (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

Methods

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

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

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

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

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

unpackedLens :: (s -> a) -> (s -> b -> t) -> UnpackedLens a b s t Source #