Copyright | (C) 2017 Csongor Kiss |
---|---|
License | BSD3 |
Maintainer | Csongor Kiss <kiss.csongor.kiss@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Internal lens helpers. Only exported for Haddock
- type Lens' s a = Lens s s a a
- type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t
- type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)
- type Prism' s a = Prism s s a a
- type Iso' s a = forall p f. (Profunctor p, Functor f) => p a (f a) -> p s (f s)
- type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t)
- (^.) :: s -> ((a -> Const a a) -> s -> Const a s) -> a
- set :: ((a -> Identity b) -> s -> Identity t) -> b -> s -> t
- (.~) :: ((a -> Identity b) -> s -> Identity t) -> b -> s -> t
- (^?) :: s -> ((a -> Const (First a) a) -> s -> Const (First a) s) -> Maybe a
- (#) :: (Tagged b (Identity b) -> Tagged t (Identity t)) -> b -> t
- first :: Lens ((a :*: b) x) ((a' :*: b) x) (a x) (a' x)
- second :: Lens ((a :*: b) x) ((a :*: b') x) (b x) (b' x)
- left :: Prism ((a :+: c) x) ((b :+: c) x) (a x) (b x)
- right :: Prism ((a :+: b) x) ((a :+: c) x) (b x) (c x)
- gsum :: (a x -> c) -> (b x -> c) -> (a :+: b) x -> c
- combine :: Lens' (s x) a -> Lens' (t x) a -> Lens' ((s :+: t) x) a
- prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b
- repIso :: (Generic a, Generic b) => Iso a b (Rep a x) (Rep b x)
- mIso :: Iso (M1 i c f p) (M1 i c g p) (f p) (g p)
- mLens :: Lens (M1 i c f p) (M1 i c g p) (f p) (g p)
- repLens :: (Generic a, Generic b) => Lens a b (Rep a x) (Rep b x)
- sumIso :: Iso' ((a :+: b) x) (Either (a x) (b x))
- _Left :: Prism' (Either a c) a
- _Right :: Prism' (Either c a) a
- data Coyoneda f b = Coyoneda (a -> b) (f a)
- inj :: Functor f => Coyoneda f a -> f a
- proj :: Functor f => f a -> Coyoneda f a
- ravel :: Functor f => ((a -> Coyoneda f b) -> s -> Coyoneda f t) -> (a -> f b) -> s -> f t
Documentation
type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t) Source #
Type alias for prism
type Iso' s a = forall p f. (Profunctor p, Functor f) => p a (f a) -> p s (f s) Source #
type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t) Source #
first :: Lens ((a :*: b) x) ((a' :*: b) x) (a x) (a' x) Source #
Lens focusing on the first element of a product
second :: Lens ((a :*: b) x) ((a :*: b') x) (b x) (b' x) Source #
Lens focusing on the second element of a product
repIso :: (Generic a, Generic b) => Iso a b (Rep a x) (Rep b x) Source #
A type and its generic representation are isomorphic