| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Profunctor.Optic.Carrier
Synopsis
- type AIso s t a b = Optic (IsoRep a b) s t a b
- type AIso' s a = AIso s s a a
- type APrism s t a b = Optic (PrismRep a b) s t a b
- type APrism' s a = APrism s s a a
- type ACoprism s t a b = Optic (CoprismRep a b) s t a b
- type ACoprism' s a = ACoprism s s a a
- type ALens s t a b = Optic (LensRep a b) s t a b
- type ALens' s a = ALens s s a a
- type AColens s t a b = Optic (ColensRep a b) s t a b
- type AColens' s a = AColens s s a a
- type ARepn f s t a b = Optic (Star f) s t a b
- type ARepn' f s a = ARepn f s s a a
- type AGrate s t a b = Optic (GrateRep a b) s t a b
- type AGrate' s a = AGrate s s a a
- type ACorepn f s t a b = Optic (Costar f) s t a b
- type ACorepn' f t b = ACorepn f t t b b
- type ATraversal0 s t a b = Optic (Traversal0Rep a b) s t a b
- type ATraversal0' s a = ATraversal0 s s a a
- type ATraversal f s t a b = Applicative f => ARepn f s t a b
- type ATraversal' f s a = ATraversal f s s a a
- type ATraversal1 f s t a b = Apply f => ARepn f s t a b
- type ATraversal1' f s a = ATraversal1 f s s a a
- type ACotraversal0 s t a b = Optic (Cotraversal0Rep a b) s t a b
- type ACotraversal0' s a = ACotraversal0 s s a a
- type ACotraversal f s t a b = Coapplicative f => ACorepn f s t a b
- type ACotraversal' f s a = ACotraversal f s s a a
- type ACotraversal1 f s t a b = Coapply f => ACorepn f s t a b
- type ACotraversal1' f s a = ACotraversal1 f s s a a
- type AList f s t a b = Foldable f => ACorepn f s t a b
- type AList' f s a = AList f s s a a
- type AList1 f s t a b = Foldable1 f => ACorepn f s t a b
- type AList1' f s a = AList1 f s s a a
- type AScope f s t a b = Traversable f => ACorepn f s t a b
- type AScope' f s a = AScope f s s a a
- type AScope1 f s t a b = Traversable1 f => ACorepn f s t a b
- type AScope1' f s a = AScope1 f s s a a
- type AFold0 r s a = Optic' (Fold0Rep r) s a
- type AFold r s a = Monoid r => ARepn' (Const r) s a
- type AFold1 r s a = Semigroup r => ARepn' (Const r) s a
- type ACofold r t b = ACorepn' (Const r) t b
- type AView r s a = ARepn' (Const r) s a
- type AReview t b = Optic' Tagged t b
- withIso :: AIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r
- withPrism :: APrism s t a b -> ((s -> t + a) -> (b -> t) -> r) -> r
- withCoprism :: ACoprism s t a b -> ((s -> a) -> (b -> a + t) -> r) -> r
- withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
- withColens :: AColens s t a b -> ((b -> s -> a) -> (b -> t) -> r) -> r
- withLensVl :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t
- withGrate :: AGrate s t a b -> ((((s -> a) -> b) -> t) -> r) -> r
- withGrateVl :: Functor f => AGrate s t a b -> (f a -> b) -> f s -> t
- withAffine :: ATraversal0 s t a b -> ((s -> t + a) -> (s -> b -> t) -> r) -> r
- withStar :: ARepn f s t a b -> (a -> f b) -> s -> f t
- withCoaffine :: ACotraversal0 s t a b -> ((((s -> t + a) -> b) -> t) -> r) -> r
- withCostar :: ACorepn f s t a b -> (f a -> b) -> f s -> t
- withFold0 :: Optic (Fold0Rep r) s t a b -> (a -> Maybe r) -> s -> Maybe r
- withFold :: Monoid r => AFold r s a -> (a -> r) -> s -> r
- withFold1 :: Semigroup r => AFold1 r s a -> (a -> r) -> s -> r
- withCofold :: ACofold r t b -> (r -> b) -> r -> t
- withView :: AView r s a -> (a -> r) -> s -> r
- withReview :: AReview t b -> (t -> r) -> b -> r
- data IsoRep a b s t = IsoRep (s -> a) (b -> t)
- data PrismRep a b s t = PrismRep (s -> t + a) (b -> t)
- data CoprismRep a b s t = CoprismRep (s -> a) (b -> a + t)
- newtype Cotraversal0Rep a b s t = Cotraversal0Rep {
- unCotraversal0Rep :: ((s -> t + a) -> b) -> t
- data LensRep a b s t = LensRep (s -> a) (s -> b -> t)
- data ColensRep a b s t = ColensRep (b -> s -> a) (b -> t)
- newtype GrateRep a b s t = GrateRep {
- unGrateRep :: ((s -> a) -> b) -> t
- data Traversal0Rep a b s t = Traversal0Rep (s -> t + a) (s -> b -> t)
- newtype Fold0Rep r a b = Fold0Rep {
- runFold0Rep :: a -> Maybe r
- newtype Star (f :: Type -> Type) d c = Star {
- runStar :: d -> f c
- newtype Costar (f :: Type -> Type) d c = Costar {
- runCostar :: f d -> c
- newtype Tagged (s :: k) b :: forall k. k -> Type -> Type = Tagged {
- unTagged :: b
- data Index a b s = Index a (b -> s)
- vals :: Index a b s -> b -> s
- info :: Index a b s -> a
- newtype Coindex a b s = Coindex {
- runCoindex :: (s -> a) -> b
- trivial :: Coindex a b a -> b
- noindex :: Monoid s => (a -> b) -> Coindex a b s
- coindex :: Functor f => s -> (a -> b) -> Coindex (f a) (f b) s
- (.#.) :: Semigroup s => Coindex b c s -> Coindex a b s -> Coindex a c s
- newtype Conjoin j a b = Conjoin {
- unConjoin :: j -> a -> b
Carrier types
type ACoprism s t a b = Optic (CoprismRep a b) s t a b Source #
type ATraversal0 s t a b = Optic (Traversal0Rep a b) s t a b Source #
type ATraversal0' s a = ATraversal0 s s a a Source #
type ATraversal f s t a b = Applicative f => ARepn f s t a b Source #
type ATraversal' f s a = ATraversal f s s a a Source #
type ATraversal1 f s t a b = Apply f => ARepn f s t a b Source #
type ATraversal1' f s a = ATraversal1 f s s a a Source #
type ACotraversal0 s t a b = Optic (Cotraversal0Rep a b) s t a b Source #
type ACotraversal0' s a = ACotraversal0 s s a a Source #
type ACotraversal f s t a b = Coapplicative f => ACorepn f s t a b Source #
type ACotraversal' f s a = ACotraversal f s s a a Source #
type ACotraversal1 f s t a b = Coapply f => ACorepn f s t a b Source #
type ACotraversal1' f s a = ACotraversal1 f s s a a Source #
type AScope f s t a b = Traversable f => ACorepn f s t a b Source #
type AScope1 f s t a b = Traversable1 f => ACorepn f s t a b Source #
Primitive operators
withIso :: AIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r Source #
Extract the two functions that characterize an Iso.
withPrism :: APrism s t a b -> ((s -> t + a) -> (b -> t) -> r) -> r Source #
Extract the two functions that characterize a Prism.
withCoprism :: ACoprism s t a b -> ((s -> a) -> (b -> a + t) -> r) -> r Source #
Extract the two functions that characterize a Coprism.
withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r Source #
Extract the two functions that characterize a Lens.
withColens :: AColens s t a b -> ((b -> s -> a) -> (b -> t) -> r) -> r Source #
Extract the two functions that characterize a Colens.
withLensVl :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t Source #
withGrate :: AGrate s t a b -> ((((s -> a) -> b) -> t) -> r) -> r Source #
Extract the function that characterizes a Grate.
withGrateVl :: Functor f => AGrate s t a b -> (f a -> b) -> f s -> t Source #
withAffine :: ATraversal0 s t a b -> ((s -> t + a) -> (s -> b -> t) -> r) -> r Source #
TODO: Document
withCoaffine :: ACotraversal0 s t a b -> ((((s -> t + a) -> b) -> t) -> r) -> r Source #
TODO: Document
withCostar :: ACorepn f s t a b -> (f a -> b) -> f s -> t Source #
TODO: Document
withFold1 :: Semigroup r => AFold1 r s a -> (a -> r) -> s -> r Source #
Map an optic to a semigroup and combine the results.
withCofold :: ACofold r t b -> (r -> b) -> r -> t Source #
withReview :: AReview t b -> (t -> r) -> b -> r Source #
TODO: Document
Carrier profunctors
Constructors
| IsoRep (s -> a) (b -> t) |
Instances
| Profunctor (IsoRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> IsoRep a b b0 c -> IsoRep a b a0 d # lmap :: (a0 -> b0) -> IsoRep a b b0 c -> IsoRep a b a0 c # rmap :: (b0 -> c) -> IsoRep a b a0 b0 -> IsoRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> IsoRep a b a0 b0 -> IsoRep a b a0 c # (.#) :: Coercible b0 a0 => IsoRep a b b0 c -> q a0 b0 -> IsoRep a b a0 c # | |
| Sieve (IsoRep a b) (Index a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Cosieve (IsoRep a b) (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
data PrismRep a b s t Source #
Instances
| Choice (PrismRep a b) Source # | |
| Profunctor (PrismRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> PrismRep a b b0 c -> PrismRep a b a0 d # lmap :: (a0 -> b0) -> PrismRep a b b0 c -> PrismRep a b a0 c # rmap :: (b0 -> c) -> PrismRep a b a0 b0 -> PrismRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> PrismRep a b a0 b0 -> PrismRep a b a0 c # (.#) :: Coercible b0 a0 => PrismRep a b b0 c -> q a0 b0 -> PrismRep a b a0 c # | |
data CoprismRep a b s t Source #
Constructors
| CoprismRep (s -> a) (b -> a + t) |
Instances
| Cochoice (CoprismRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods unleft :: CoprismRep a b (Either a0 d) (Either b0 d) -> CoprismRep a b a0 b0 # unright :: CoprismRep a b (Either d a0) (Either d b0) -> CoprismRep a b a0 b0 # | |
| Profunctor (CoprismRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> CoprismRep a b b0 c -> CoprismRep a b a0 d # lmap :: (a0 -> b0) -> CoprismRep a b b0 c -> CoprismRep a b a0 c # rmap :: (b0 -> c) -> CoprismRep a b a0 b0 -> CoprismRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> CoprismRep a b a0 b0 -> CoprismRep a b a0 c # (.#) :: Coercible b0 a0 => CoprismRep a b b0 c -> q a0 b0 -> CoprismRep a b a0 c # | |
| Functor (CoprismRep a b s) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods fmap :: (a0 -> b0) -> CoprismRep a b s a0 -> CoprismRep a b s b0 # (<$) :: a0 -> CoprismRep a b s b0 -> CoprismRep a b s a0 # | |
newtype Cotraversal0Rep a b s t Source #
The Cotraversal0Rep profunctor precisely characterizes Cotraversal0.
Constructors
| Cotraversal0Rep | |
Fields
| |
Instances
| Choice (Cotraversal0Rep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods left' :: Cotraversal0Rep a b a0 b0 -> Cotraversal0Rep a b (Either a0 c) (Either b0 c) # right' :: Cotraversal0Rep a b a0 b0 -> Cotraversal0Rep a b (Either c a0) (Either c b0) # | |
| Closed (Cotraversal0Rep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods closed :: Cotraversal0Rep a b a0 b0 -> Cotraversal0Rep a b (x -> a0) (x -> b0) # | |
| Profunctor (Cotraversal0Rep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> Cotraversal0Rep a b b0 c -> Cotraversal0Rep a b a0 d # lmap :: (a0 -> b0) -> Cotraversal0Rep a b b0 c -> Cotraversal0Rep a b a0 c # rmap :: (b0 -> c) -> Cotraversal0Rep a b a0 b0 -> Cotraversal0Rep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> Cotraversal0Rep a b a0 b0 -> Cotraversal0Rep a b a0 c # (.#) :: Coercible b0 a0 => Cotraversal0Rep a b b0 c -> q a0 b0 -> Cotraversal0Rep a b a0 c # | |
Constructors
| LensRep (s -> a) (s -> b -> t) |
Instances
| Representable (LensRep a b) Source # | |
| Strong (LensRep a b) Source # | |
| Profunctor (LensRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> LensRep a b b0 c -> LensRep a b a0 d # lmap :: (a0 -> b0) -> LensRep a b b0 c -> LensRep a b a0 c # rmap :: (b0 -> c) -> LensRep a b a0 b0 -> LensRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> LensRep a b a0 b0 -> LensRep a b a0 c # (.#) :: Coercible b0 a0 => LensRep a b b0 c -> q a0 b0 -> LensRep a b a0 c # | |
| Sieve (LensRep a b) (Index a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| type Rep (LensRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
data ColensRep a b s t Source #
Constructors
| ColensRep (b -> s -> a) (b -> t) |
Instances
| Profunctor (ColensRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> ColensRep a b b0 c -> ColensRep a b a0 d # lmap :: (a0 -> b0) -> ColensRep a b b0 c -> ColensRep a b a0 c # rmap :: (b0 -> c) -> ColensRep a b a0 b0 -> ColensRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> ColensRep a b a0 b0 -> ColensRep a b a0 c # (.#) :: Coercible b0 a0 => ColensRep a b b0 c -> q a0 b0 -> ColensRep a b a0 c # | |
newtype GrateRep a b s t Source #
Constructors
| GrateRep | |
Fields
| |
Instances
| Corepresentable (GrateRep a b) Source # | |
| Closed (GrateRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Costrong (GrateRep a b) Source # | |
| Profunctor (GrateRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a0 -> b0) -> (c -> d) -> GrateRep a b b0 c -> GrateRep a b a0 d # lmap :: (a0 -> b0) -> GrateRep a b b0 c -> GrateRep a b a0 c # rmap :: (b0 -> c) -> GrateRep a b a0 b0 -> GrateRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> GrateRep a b a0 b0 -> GrateRep a b a0 c # (.#) :: Coercible b0 a0 => GrateRep a b b0 c -> q a0 b0 -> GrateRep a b a0 c # | |
| Cosieve (GrateRep a b) (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| type Corep (GrateRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
data Traversal0Rep a b s t Source #
The Traversal0Rep profunctor precisely characterizes an Traversal0.
Constructors
| Traversal0Rep (s -> t + a) (s -> b -> t) |
Instances
newtype Fold0Rep r a b Source #
Constructors
| Fold0Rep | |
Fields
| |
Instances
| Representable (Fold0Rep r) Source # | |
| Choice (Fold0Rep r) Source # | |
| Cochoice (Fold0Rep r) Source # | |
| Strong (Fold0Rep r) Source # | |
| Profunctor (Fold0Rep r) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods dimap :: (a -> b) -> (c -> d) -> Fold0Rep r b c -> Fold0Rep r a d # lmap :: (a -> b) -> Fold0Rep r b c -> Fold0Rep r a c # rmap :: (b -> c) -> Fold0Rep r a b -> Fold0Rep r a c # (#.) :: Coercible c b => q b c -> Fold0Rep r a b -> Fold0Rep r a c # (.#) :: Coercible b a => Fold0Rep r b c -> q a b -> Fold0Rep r a c # | |
| Functor (Fold0Rep r a) Source # | |
| Contravariant (Fold0Rep r a) Source # | |
| type Rep (Fold0Rep r) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
newtype Star (f :: Type -> Type) d c #
Lift a Functor into a Profunctor (forwards).
Instances
| Functor f => Representable (Star f) | |
| Applicative f => Choice (Star f) | |
| Traversable f => Cochoice (Star f) | |
| Distributive f => Closed (Star f) | |
Defined in Data.Profunctor.Closed | |
| Functor m => Strong (Star m) | |
| Functor f => Profunctor (Star f) | |
Defined in Data.Profunctor.Types | |
| Functor f => Sieve (Star f) f | |
Defined in Data.Profunctor.Sieve | |
| Monad f => Category (Star f :: Type -> Type -> Type) | |
| Monad f => Monad (Star f a) | |
| Functor f => Functor (Star f a) | |
| Applicative f => Applicative (Star f a) | |
| Distributive f => Distributive (Star f a) | |
Defined in Data.Profunctor.Types | |
| Contravariant f => Contravariant (Star f a) | |
| Alternative f => Alternative (Star f a) | |
| MonadPlus f => MonadPlus (Star f a) | |
| Apply f => Apply (Star f a) Source # | |
| type Rep (Star f) | |
Defined in Data.Profunctor.Rep | |
newtype Costar (f :: Type -> Type) d c #
Lift a Functor into a Profunctor (backwards).
Instances
| Contravariant f => Bifunctor (Costar f) Source # | |
| Functor f => Corepresentable (Costar f) | |
| Coapplicative f => Choice (Costar f) Source # | |
| Applicative f => Cochoice (Costar f) | |
| Functor f => Closed (Costar f) | |
Defined in Data.Profunctor.Closed | |
| Functor f => Costrong (Costar f) | |
| Functor f => Profunctor (Costar f) | |
Defined in Data.Profunctor.Types | |
| Functor f => Cosieve (Costar f) f | |
Defined in Data.Profunctor.Sieve | |
| Monad (Costar f a) | |
| Functor (Costar f a) | |
| Applicative (Costar f a) | |
Defined in Data.Profunctor.Types | |
| Distributive (Costar f d) | |
Defined in Data.Profunctor.Types | |
| Apply (Costar f a) Source # | |
| type Corep (Costar f) | |
Defined in Data.Profunctor.Rep | |
newtype Tagged (s :: k) b :: forall k. k -> Type -> Type #
A value is a value Tagged s bb with an attached phantom type s.
This can be used in place of the more traditional but less safe idiom of
passing in an undefined value with the type, because unlike an (s -> b),
a can't try to use the argument Tagged s bs as a real value.
Moreover, you don't have to rely on the compiler to inline away the extra argument, because the newtype is "free"
Tagged has kind k -> * -> * if the compiler supports PolyKinds, therefore
there is an extra k showing in the instance haddocks that may cause confusion.
Instances
Index
An indexed store that characterizes a Lens
,Index a b s ≡ forall f. Functor f => (a -> f b) -> f s
See also withLensVl.
Constructors
| Index a (b -> s) |
Instances
| Profunctor (Index a) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Functor (Index a b) Source # | |
| a ~ b => Foldable (Index a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods fold :: Monoid m => Index a b m -> m # foldMap :: Monoid m => (a0 -> m) -> Index a b a0 -> m # foldr :: (a0 -> b0 -> b0) -> b0 -> Index a b a0 -> b0 # foldr' :: (a0 -> b0 -> b0) -> b0 -> Index a b a0 -> b0 # foldl :: (b0 -> a0 -> b0) -> b0 -> Index a b a0 -> b0 # foldl' :: (b0 -> a0 -> b0) -> b0 -> Index a b a0 -> b0 # foldr1 :: (a0 -> a0 -> a0) -> Index a b a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Index a b a0 -> a0 # toList :: Index a b a0 -> [a0] # null :: Index a b a0 -> Bool # length :: Index a b a0 -> Int # elem :: Eq a0 => a0 -> Index a b a0 -> Bool # maximum :: Ord a0 => Index a b a0 -> a0 # minimum :: Ord a0 => Index a b a0 -> a0 # | |
| Sieve (LensRep a b) (Index a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Sieve (IsoRep a b) (Index a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Generic (Index a b s) Source # | |
| type Rep (Index a b s) Source # | |
Defined in Data.Profunctor.Optic.Carrier type Rep (Index a b s) = D1 (MetaData "Index" "Data.Profunctor.Optic.Carrier" "profunctor-optics-0.0.2-BQ5vHMWylUn3p9oJtWEgRF" False) (C1 (MetaCons "Index" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (b -> s)))) | |
Coindex
newtype Coindex a b s Source #
An indexed continuation that characterizes a Grate
,Coindex a b s ≡ forall f. Functor f => (f a -> b) -> f s
See also withGrateVl.
Coindex can also be used to compose indexed maps, folds, or traversals directly.
For example, using the containers library:
Coindex mapWithKey :: Coindex (a -> b) (Map k a -> Map k b) k Coindex foldMapWithKey :: Monoid m => Coindex (a -> m) (Map k a -> m) k Coindex traverseWithKey :: Applicative t => Coindex (a -> t b) (Map k a -> t (Map k b)) k
Constructors
| Coindex | |
Fields
| |
Instances
| Functor (Coindex a b) Source # | |
| a ~ b => Applicative (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier Methods pure :: a0 -> Coindex a b a0 # (<*>) :: Coindex a b (a0 -> b0) -> Coindex a b a0 -> Coindex a b b0 # liftA2 :: (a0 -> b0 -> c) -> Coindex a b a0 -> Coindex a b b0 -> Coindex a b c # (*>) :: Coindex a b a0 -> Coindex a b b0 -> Coindex a b b0 # (<*) :: Coindex a b a0 -> Coindex a b b0 -> Coindex a b a0 # | |
| a ~ b => Apply (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Cosieve (GrateRep a b) (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Cosieve (IsoRep a b) (Coindex a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
| Generic (Coindex a b s) Source # | |
| type Rep (Coindex a b s) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
noindex :: Monoid s => (a -> b) -> Coindex a b s Source #
Lift a regular function into a coindexed function.
For example, to traverse two layers, keeping only the first index:
CoindexmapWithKey.#. noindexmap:: Monoid k => Coindex (a -> b) (Map k (Map j a) -> Map k (Map j b)) k
(.#.) :: Semigroup s => Coindex b c s -> Coindex a b s -> Coindex a c s infixr 9 Source #
Compose two coindexes.
When s is a Monoid, Coindex can be used to compose indexed traversals, folds, etc.
For example, to keep track of only the first index seen, use Data.Monoid.First:
fmap (First . pure) :: Coindex a b c -> Coindex a b (First c)
or keep track of all indices using a list:
fmap (:[]) :: Coindex a b c -> Coindex a b [c]
Conjoin
newtype Conjoin j a b Source #