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

Fresnel.Lens

Synopsis

Lenses

type Lens s t a b = forall p. 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 Source #

Instances

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

Defined in Fresnel.Lens.Internal

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

Defined in Fresnel.Lens.Internal

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

Defined in Fresnel.Lens.Internal

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 (UnpackedOptional a b) Source # 
Instance details

Defined in Fresnel.Optional

IsLens (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

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

alongside :: Lens s1 t1 a1 b1 -> Lens s2 t2 a2 b2 -> Lens (s1, s2) (t1, t2) (a1, a2) (b1, b2) 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
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

IsIso (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

IsLens (UnpackedLens a b) Source # 
Instance details

Defined in Fresnel.Lens

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