Copyright | (C) 2017 Csongor Kiss |
---|---|
License | BSD3 |
Maintainer | Csongor Kiss <kiss.csongor.kiss@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Internal lens helpers. Only exported for Haddock
Synopsis
- type Iso s t a b = forall p. Profunctor p => p a b -> p s t
- type Iso' s a = Iso s s a a
- 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)
- kIso :: Iso (K1 r a p) (K1 r b p) a b
- recIso :: Iso (Rec r a p) (Rec r b p) a b
- sumIso :: Iso ((a :+: b) x) ((a' :+: b') x) (Either (a x) (b x)) (Either (a' x) (b' x))
- prodIso :: Iso ((a :*: b) x) ((a' :*: b') x) (a x, b x) (a' x, b' x)
- assoc3 :: Iso ((a, b), c) ((a', b'), c') (a, (b, c)) (a', (b', c'))
- fromIso :: Iso s t a b -> Iso b a t s
- iso :: (s -> a) -> (b -> t) -> Iso s t a b
- withIso :: Iso s t a b -> ((s -> a) -> (b -> t) -> r) -> r
- pairing :: Iso s t a b -> Iso s' t' a' b' -> Iso (s, s') (t, t') (a, a') (b, b')
- data Exchange a b s t = Exchange (s -> a) (b -> t)
Documentation
type Iso s t a b = forall p. Profunctor p => p a b -> p s t Source #
repIso :: (Generic a, Generic b) => Iso a b (Rep a x) (Rep b x) Source #
A type and its generic representation are isomorphic
mIso :: Iso (M1 i c f p) (M1 i c g p) (f p) (g p) Source #
M1
is just a wrapper around `f p`
mIso :: Iso' (M1 i c f p) (f p)
data Exchange a b s t Source #
Exchange (s -> a) (b -> t) |
Instances
Profunctor (Exchange a b) Source # | |
Defined in Data.Generics.Internal.Profunctor.Iso dimap :: (a0 -> b0) -> (c -> d) -> Exchange a b b0 c -> Exchange a b a0 d # lmap :: (a0 -> b0) -> Exchange a b b0 c -> Exchange a b a0 c # rmap :: (b0 -> c) -> Exchange a b a0 b0 -> Exchange a b a0 c # (#.) :: Coercible c b0 => q b0 c -> Exchange a b a0 b0 -> Exchange a b a0 c # (.#) :: Coercible b0 a0 => Exchange a b b0 c -> q a0 b0 -> Exchange a b a0 c # | |
Functor (Exchange a b s) Source # | |