Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Lens s t a b = forall (p :: Type -> Type -> Type). IsLens p => Optic p s t a b
- type Lens' s a = Lens s s a a
- class (IsIso p, Strong p) => IsLens (p :: Type -> Type -> Type)
- lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
- withLens :: Lens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
- choosing :: Lens s1 t1 a b -> Lens s2 t2 a b -> Lens (Either s1 s2) (Either t1 t2) a b
- chosen :: forall a b p. IsLens p => Optic p (Either a a) (Either b b) a b
- alongside :: Lens s1 t1 a1 b1 -> Lens s2 t2 a2 b2 -> Lens (s1, s2) (t1, t2) (a1, a2) (b1, b2)
- 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)
- devoid :: forall a b p. IsLens p => Optic p Void Void a b
- united :: forall a p. IsLens p => Optic p a a () ()
- newtype UnpackedLens a b s t = UnpackedLens {
- withUnpackedLens :: forall r. ((s -> a) -> (s -> b -> t) -> r) -> r
- unpackedLens :: (s -> a) -> (s -> b -> t) -> UnpackedLens a b s t
Lenses
class (IsIso p, Strong p) => IsLens (p :: Type -> Type -> Type) Source #
Instances
Functor f => IsLens (OptionalStar f) Source # | |
Defined in Fresnel.Lens.Internal | |
Functor f => IsLens (Star1 f) Source # | |
Defined in Fresnel.Lens.Internal | |
Monad m => IsLens (Kleisli m) Source # | |
Defined in Fresnel.Lens.Internal | |
IsLens (UnpackedLens a b) Source # | |
Defined in Fresnel.Lens | |
IsLens (UnpackedOptional a b) Source # | |
Defined in Fresnel.Optional | |
IsLens (Forget r :: Type -> Type -> Type) Source # | |
Defined in Fresnel.Lens.Internal | |
Functor f => IsLens (Star f) Source # | |
Defined in Fresnel.Lens.Internal | |
IsLens (->) Source # | |
Defined in Fresnel.Lens.Internal |
Construction
Elimination
Combinators
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 #
Unpacked
newtype UnpackedLens a b s t Source #
A Lens
unpacked into the get & set functions it was constructed from.
UnpackedLens | |
|
Instances
IsIso (UnpackedLens a b) Source # | |
Defined in Fresnel.Lens | |
IsLens (UnpackedLens a b) Source # | |
Defined in Fresnel.Lens | |
Strong (UnpackedLens a b) Source # | |
Defined in Fresnel.Lens 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 # | |
Defined in Fresnel.Lens 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 #