Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 ALens s t a b = Optic (LensRep a b) s t a b
- type ALens' s a = ALens s s a a
- type AIxlens i s t a b = IndexedOptic (IxlensRep i a b) i s t a b
- type AIxlens' i s a = AIxlens i 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 ACxgrate k s t a b = CoindexedOptic (CxgrateRep k a b) k s t a b
- type ACxgrate' k s a = ACxgrate k s s a a
- type AAffine s t a b = Optic (AffineRep a b) s t a b
- type AAffine' s a = AAffine s s a a
- type AOption r s a = Optic' (OptionRep r) s a
- type AIxoption r i s a = IndexedOptic' (OptionRep r) i s a
- type AGrism s t a b = Optic (GrismRep a b) s t a b
- type AGrism' s a = AGrism 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 AIxrepn f i s t a b = IndexedOptic (Star f) i s t a b
- type AIxrepn' f i s a = AIxrepn f i 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 AIxtraversal f i s t a b = Applicative f => AIxrepn f i s t a b
- type AIxtraversal' f i s a = AIxtraversal f i 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 AIxtraversal1 f i s t a b = Apply f => AIxrepn f i s t a b
- type AIxtraversal1' f i s a = AIxtraversal1 f i s s a a
- type AFold r s a = ARepn' (Const r) s a
- type AIxfold r i s a = AIxrepn' (Const r) i s a
- type AFold1 r s a = ARepn' (Const r) s a
- type AIxfold1 r i s a = AIxrepn' (Const r) i s a
- type APrimView r s t a b = ARepn (Const r) s t a b
- type AView s a = ARepn' (Const a) s a
- type AIxview i s a = AIxrepn' (Const (Maybe i, a)) i s a
- type AIxsetter i s t a b = IndexedOptic (->) i s t a b
- type AIxsetter' i s a = AIxsetter i 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 ACxrepn' f k t b = ACxrepn f k t t b b
- 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 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 APrimReview s t a b = Optic Tagged s t a b
- type AReview t b = Optic' Tagged t b
- type ACxview k t b = CoindexedOptic' Tagged k t b
- type ACxsetter k s t a b = CoindexedOptic (->) k s t a b
- type ACxsetter' k t b = ACxsetter k t t b 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
- withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
- withIxlens :: (Additive - Monoid) i => AIxlens i s t a b -> ((s -> (i, a)) -> (s -> b -> t) -> r) -> r
- withGrate :: AGrate s t a b -> ((((s -> a) -> b) -> t) -> r) -> r
- withCxgrate :: (Additive - Monoid) k => ACxgrate k s t a b -> ((((s -> a) -> k -> b) -> t) -> r) -> r
- withAffine :: AAffine s t a b -> ((s -> t + a) -> (s -> b -> t) -> r) -> r
- withGrism :: AGrism s t a b -> ((((s -> t + a) -> b) -> t) -> r) -> r
- withOption :: Optic (OptionRep r) s t a b -> (a -> Maybe r) -> s -> Maybe r
- withIxoption :: (Additive - Monoid) i => AIxoption r i s a -> (i -> a -> Maybe r) -> s -> Maybe r
- withStar :: ARepn f s t a b -> (a -> f b) -> s -> f t
- withCostar :: ACorepn f s t a b -> (f a -> b) -> f s -> t
- withPrimView :: APrimView r s t a b -> (a -> r) -> s -> r
- withPrimReview :: APrimReview s t a b -> (t -> r) -> b -> r
- withIxsetter :: IndexedOptic (->) i s t a b -> (i -> a -> b) -> i -> s -> t
- withCxsetter :: CoindexedOptic (->) k s t a b -> (k -> a -> b) -> k -> s -> t
- data IsoRep a b s t = IsoRep (s -> a) (b -> t)
- data PrismRep a b s t = PrismRep (s -> t + a) (b -> t)
- data LensRep a b s t = LensRep (s -> a) (s -> b -> t)
- data IxlensRep i a b s t = IxlensRep (s -> (i, a)) (s -> b -> t)
- newtype GrateRep a b s t = GrateRep {
- unGrateRep :: ((s -> a) -> b) -> t
- newtype CxgrateRep k a b s t = CxgrateRep {
- unCxgrateRep :: ((s -> a) -> k -> b) -> t
- data AffineRep a b s t = AffineRep (s -> t + a) (s -> b -> t)
- newtype GrismRep a b s t = GrismRep {
- unGrismRep :: ((s -> t + a) -> b) -> t
- newtype OptionRep r a b = OptionRep {
- runOptionRep :: 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
Carrier types
type AIxlens i s t a b = IndexedOptic (IxlensRep i a b) i s t a b Source #
type ACxgrate k s t a b = CoindexedOptic (CxgrateRep k a b) k s t a b Source #
type AIxoption r i s a = IndexedOptic' (OptionRep r) i s a Source #
type AIxrepn f i s t a b = IndexedOptic (Star f) i s t a b 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 AIxtraversal f i s t a b = Applicative f => AIxrepn f i s t a b Source #
type AIxtraversal' f i s a = AIxtraversal f i 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 AIxtraversal1 f i s t a b = Apply f => AIxrepn f i s t a b Source #
type AIxtraversal1' f i s a = AIxtraversal1 f i s s a a Source #
type AIxsetter i s t a b = IndexedOptic (->) i s t a b Source #
type AIxsetter' i s a = AIxsetter i 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 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 #
type APrimReview s t a b = Optic Tagged s t a b Source #
type ACxview k t b = CoindexedOptic' Tagged k t b Source #
type ACxsetter k s t a b = CoindexedOptic (->) k s t a b Source #
type ACxsetter' k t b = ACxsetter k t t b 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
.
withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r Source #
Extract the two functions that characterize a Lens
.
withIxlens :: (Additive - Monoid) i => AIxlens i s t a b -> ((s -> (i, a)) -> (s -> b -> t) -> r) -> r Source #
Extract the two functions that characterize a Lens
.
withGrate :: AGrate s t a b -> ((((s -> a) -> b) -> t) -> r) -> r Source #
Extract the function that characterizes a Grate
.
withCxgrate :: (Additive - Monoid) k => ACxgrate k s t a b -> ((((s -> a) -> k -> b) -> t) -> r) -> r Source #
withAffine :: AAffine s t a b -> ((s -> t + a) -> (s -> b -> t) -> r) -> r Source #
TODO: Document
withIxoption :: (Additive - Monoid) i => AIxoption r i s a -> (i -> a -> Maybe r) -> s -> Maybe r Source #
TODO: Document
withCostar :: ACorepn f s t a b -> (f a -> b) -> f s -> t Source #
TODO: Document
withPrimView :: APrimView r s t a b -> (a -> r) -> s -> r Source #
TODO: Document
withPrimReview :: APrimReview s t a b -> (t -> r) -> b -> r Source #
TODO: Document
withIxsetter :: IndexedOptic (->) i s t a b -> (i -> a -> b) -> i -> s -> t Source #
TODO: Document
withCxsetter :: CoindexedOptic (->) k s t a b -> (k -> a -> b) -> k -> s -> t Source #
TODO: Document
Carrier profunctors
IsoRep (s -> a) (b -> t) |
Instances
Profunctor (IsoRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier 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 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 # |
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 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 IxlensRep i a b s t Source #
IxlensRep (s -> (i, a)) (s -> b -> t) |
Instances
Strong (IxlensRep i a b) Source # | |
Profunctor (IxlensRep i a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier dimap :: (a0 -> b0) -> (c -> d) -> IxlensRep i a b b0 c -> IxlensRep i a b a0 d # lmap :: (a0 -> b0) -> IxlensRep i a b b0 c -> IxlensRep i a b a0 c # rmap :: (b0 -> c) -> IxlensRep i a b a0 b0 -> IxlensRep i a b a0 c # (#.) :: Coercible c b0 => q b0 c -> IxlensRep i a b a0 b0 -> IxlensRep i a b a0 c # (.#) :: Coercible b0 a0 => IxlensRep i a b b0 c -> q a0 b0 -> IxlensRep i a b a0 c # |
newtype GrateRep a b s t Source #
GrateRep | |
|
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 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 |
newtype CxgrateRep k a b s t Source #
CxgrateRep | |
|
Instances
Closed (CxgrateRep k a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier closed :: CxgrateRep k a b a0 b0 -> CxgrateRep k a b (x -> a0) (x -> b0) # | |
Profunctor (CxgrateRep k a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier dimap :: (a0 -> b0) -> (c -> d) -> CxgrateRep k a b b0 c -> CxgrateRep k a b a0 d # lmap :: (a0 -> b0) -> CxgrateRep k a b b0 c -> CxgrateRep k a b a0 c # rmap :: (b0 -> c) -> CxgrateRep k a b a0 b0 -> CxgrateRep k a b a0 c # (#.) :: Coercible c b0 => q b0 c -> CxgrateRep k a b a0 b0 -> CxgrateRep k a b a0 c # (.#) :: Coercible b0 a0 => CxgrateRep k a b b0 c -> q a0 b0 -> CxgrateRep k a b a0 c # |
data AffineRep a b s t Source #
Instances
Representable (AffineRep a b) Source # | |
Choice (AffineRep a b) Source # | |
Strong (AffineRep a b) Source # | |
Profunctor (AffineRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier dimap :: (a0 -> b0) -> (c -> d) -> AffineRep a b b0 c -> AffineRep a b a0 d # lmap :: (a0 -> b0) -> AffineRep a b b0 c -> AffineRep a b a0 c # rmap :: (b0 -> c) -> AffineRep a b a0 b0 -> AffineRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> AffineRep a b a0 b0 -> AffineRep a b a0 c # (.#) :: Coercible b0 a0 => AffineRep a b b0 c -> q a0 b0 -> AffineRep a b a0 c # | |
type Rep (AffineRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier |
newtype GrismRep a b s t Source #
GrismRep | |
|
Instances
Choice (GrismRep a b) Source # | |
Closed (GrismRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier | |
Profunctor (GrismRep a b) Source # | |
Defined in Data.Profunctor.Optic.Carrier dimap :: (a0 -> b0) -> (c -> d) -> GrismRep a b b0 c -> GrismRep a b a0 d # lmap :: (a0 -> b0) -> GrismRep a b b0 c -> GrismRep a b a0 c # rmap :: (b0 -> c) -> GrismRep a b a0 b0 -> GrismRep a b a0 c # (#.) :: Coercible c b0 => q b0 c -> GrismRep a b a0 b0 -> GrismRep a b a0 c # (.#) :: Coercible b0 a0 => GrismRep a b b0 c -> q a0 b0 -> GrismRep a b a0 c # |
newtype OptionRep r a b Source #
OptionRep | |
|
Instances
Representable (OptionRep r) Source # | |
Choice (OptionRep r) Source # | |
Cochoice (OptionRep r) Source # | |
Strong (OptionRep r) Source # | |
Profunctor (OptionRep r) Source # | |
Defined in Data.Profunctor.Optic.Carrier dimap :: (a -> b) -> (c -> d) -> OptionRep r b c -> OptionRep r a d # lmap :: (a -> b) -> OptionRep r b c -> OptionRep r a c # rmap :: (b -> c) -> OptionRep r a b -> OptionRep r a c # (#.) :: Coercible c b => q b c -> OptionRep r a b -> OptionRep r a c # (.#) :: Coercible b a => OptionRep r b c -> q a b -> OptionRep r a c # | |
Functor (OptionRep r a) Source # | |
Contravariant (OptionRep r a) Source # | |
type Rep (OptionRep 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.