profunctor-optics-0.0.2: A compact optics library compatible with the typeclasses in profunctors.

Safe HaskellNone
LanguageHaskell2010

Data.Profunctor.Optic.Carrier

Contents

Synopsis

Carrier types

type AIso s t a b = Optic (IsoRep a b) s t a b Source #

type AIso' s a = AIso s s a a Source #

type APrism s t a b = Optic (PrismRep a b) s t a b Source #

type APrism' s a = APrism s s a a Source #

type ACoprism s t a b = Optic (CoprismRep a b) s t a b Source #

type ACoprism' s a = ACoprism s s a a Source #

type ALens s t a b = Optic (LensRep a b) s t a b Source #

type ALens' s a = ALens s s a a Source #

type AColens s t a b = Optic (ColensRep a b) s t a b Source #

type AColens' s a = AColens s s a a Source #

type ARepn f s t a b = Optic (Star f) s t a b Source #

type ARepn' f s a = ARepn f s s a a Source #

type AGrate s t a b = Optic (GrateRep a b) s t a b Source #

type AGrate' s a = AGrate s s a a Source #

type ACorepn f s t a b = Optic (Costar f) s t a b Source #

type ACorepn' f t b = ACorepn f t t b 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 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 AList f s t a b = Foldable f => ACorepn f s t a b Source #

type AList' f s a = AList f s s a a Source #

type AList1 f s t a b = Foldable1 f => ACorepn f s t a b Source #

type AList1' f s a = AList1 f s s a a Source #

type AScope f s t a b = Traversable f => ACorepn f s t a b Source #

type AScope' f s a = AScope f s s a a Source #

type AScope1 f s t a b = Traversable1 f => ACorepn f s t a b Source #

type AScope1' f s a = AScope1 f s s a a Source #

type AFold0 r s a = Optic' (Fold0Rep r) s a Source #

type AFold r s a = Monoid r => ARepn' (Const r) s a Source #

type AFold1 r s a = Semigroup r => ARepn' (Const r) s a Source #

type ACofold r t b = ACorepn' (Const r) t b Source #

type AView r s a = ARepn' (Const r) s a Source #

type AReview t b = Optic' Tagged t 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 #

Extract the higher order function that characterizes a Lens.

The lens laws can be stated in terms of withLens:

Identity:

withLensVl o Identity ≡ Identity

Composition:

Compose . fmap (withLensVl o f) . withLensVl o g ≡ withLensVl o (Compose . fmap f . g)

See Property.

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 #

Extract the higher order function that characterizes a Grate.

The grate laws can be stated in terms or withGrate:

Identity:

withGrateVl o runIdentity ≡ runIdentity

Composition:

withGrateVl o f . fmap (withGrateVl o g) ≡ withGrateVl o (f . fmap g . getCompose) . Compose

withAffine :: ATraversal0 s t a b -> ((s -> t + a) -> (s -> b -> t) -> r) -> r Source #

TODO: Document

withStar :: ARepn f s t a b -> (a -> f b) -> s -> f t 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

withFold0 :: Optic (Fold0Rep r) s t a b -> (a -> Maybe r) -> s -> Maybe r Source #

TODO: Document

withFold :: Monoid r => AFold r s a -> (a -> r) -> s -> r Source #

Map an optic to a monoid and combine the results.

foldMap = withFold folded_
>>> withFold both id (["foo"], ["bar", "baz"])
["foo","bar","baz"]
>>> :t withFold traversed
withFold traversed
  :: (Monoid r, Traversable f) => (a -> r) -> f a -> r

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 #

TODO: Document

>>> withCofold (from succ) (*2) 3
7

Compare withReview.

withView :: AView r s a -> (a -> r) -> s -> r Source #

TODO: Document

withReview :: AReview t b -> (t -> r) -> b -> r Source #

TODO: Document

Carrier profunctors

data IsoRep a b s t Source #

The IsoRep profunctor precisely characterizes an Iso.

Constructors

IsoRep (s -> a) (b -> t) 
Instances
Profunctor (IsoRep a b) Source # 
Instance details

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

sieve :: IsoRep a b a0 b0 -> a0 -> Index a b b0 #

Cosieve (IsoRep a b) (Coindex a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

cosieve :: IsoRep a b a0 b0 -> Coindex a b a0 -> b0 #

data PrismRep a b s t Source #

The PrismRep profunctor precisely characterizes a Prism.

Constructors

PrismRep (s -> t + a) (b -> t) 
Instances
Choice (PrismRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

left' :: PrismRep a b a0 b0 -> PrismRep a b (Either a0 c) (Either b0 c) #

right' :: PrismRep a b a0 b0 -> PrismRep a b (Either c a0) (Either c b0) #

Profunctor (PrismRep a b) Source # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 #

data LensRep a b s t Source #

The LensRep profunctor precisely characterizes a Lens.

Constructors

LensRep (s -> a) (s -> b -> t) 
Instances
Representable (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (LensRep a b) :: Type -> Type #

Methods

tabulate :: (d -> Rep (LensRep a b) c) -> LensRep a b d c #

Strong (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

first' :: LensRep a b a0 b0 -> LensRep a b (a0, c) (b0, c) #

second' :: LensRep a b a0 b0 -> LensRep a b (c, a0) (c, b0) #

Profunctor (LensRep a b) Source # 
Instance details

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

sieve :: LensRep a b a0 b0 -> a0 -> Index a b b0 #

type Rep (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Rep (LensRep a b) = Index a b

data ColensRep a b s t Source #

Constructors

ColensRep (b -> s -> a) (b -> t) 
Instances
Profunctor (ColensRep a b) Source # 
Instance details

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 #

The GrateRep profunctor precisely characterizes Grate.

Constructors

GrateRep 

Fields

Instances
Corepresentable (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Corep (GrateRep a b) :: Type -> Type #

Methods

cotabulate :: (Corep (GrateRep a b) d -> c) -> GrateRep a b d c #

Closed (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

closed :: GrateRep a b a0 b0 -> GrateRep a b (x -> a0) (x -> b0) #

Costrong (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

unfirst :: GrateRep a b (a0, d) (b0, d) -> GrateRep a b a0 b0 #

unsecond :: GrateRep a b (d, a0) (d, b0) -> GrateRep a b a0 b0 #

Profunctor (GrateRep a b) Source # 
Instance details

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

cosieve :: GrateRep a b a0 b0 -> Coindex a b a0 -> b0 #

type Corep (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Corep (GrateRep a b) = Coindex a b

data Traversal0Rep a b s t Source #

The Traversal0Rep profunctor precisely characterizes an Traversal0.

Constructors

Traversal0Rep (s -> t + a) (s -> b -> t) 
Instances
Representable (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (Traversal0Rep a b) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Traversal0Rep a b) c) -> Traversal0Rep a b d c #

Choice (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

left' :: Traversal0Rep a b a0 b0 -> Traversal0Rep a b (Either a0 c) (Either b0 c) #

right' :: Traversal0Rep a b a0 b0 -> Traversal0Rep a b (Either c a0) (Either c b0) #

Strong (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

first' :: Traversal0Rep a b a0 b0 -> Traversal0Rep a b (a0, c) (b0, c) #

second' :: Traversal0Rep a b a0 b0 -> Traversal0Rep a b (c, a0) (c, b0) #

Profunctor (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

dimap :: (a0 -> b0) -> (c -> d) -> Traversal0Rep a b b0 c -> Traversal0Rep a b a0 d #

lmap :: (a0 -> b0) -> Traversal0Rep a b b0 c -> Traversal0Rep a b a0 c #

rmap :: (b0 -> c) -> Traversal0Rep a b a0 b0 -> Traversal0Rep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> Traversal0Rep a b a0 b0 -> Traversal0Rep a b a0 c #

(.#) :: Coercible b0 a0 => Traversal0Rep a b b0 c -> q a0 b0 -> Traversal0Rep a b a0 c #

type Rep (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Rep (Traversal0Rep a b)

newtype Fold0Rep r a b Source #

Constructors

Fold0Rep 

Fields

Instances
Representable (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (Fold0Rep r) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Fold0Rep r) c) -> Fold0Rep r d c #

Choice (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

left' :: Fold0Rep r a b -> Fold0Rep r (Either a c) (Either b c) #

right' :: Fold0Rep r a b -> Fold0Rep r (Either c a) (Either c b) #

Cochoice (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

unleft :: Fold0Rep r (Either a d) (Either b d) -> Fold0Rep r a b #

unright :: Fold0Rep r (Either d a) (Either d b) -> Fold0Rep r a b #

Strong (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

first' :: Fold0Rep r a b -> Fold0Rep r (a, c) (b, c) #

second' :: Fold0Rep r a b -> Fold0Rep r (c, a) (c, b) #

Profunctor (Fold0Rep r) Source # 
Instance details

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

fmap :: (a0 -> b) -> Fold0Rep r a a0 -> Fold0Rep r a b #

(<$) :: a0 -> Fold0Rep r a b -> Fold0Rep r a a0 #

Contravariant (Fold0Rep r a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

contramap :: (a0 -> b) -> Fold0Rep r a b -> Fold0Rep r a a0 #

(>$) :: b -> Fold0Rep r a b -> Fold0Rep r a a0 #

type Rep (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Rep (Fold0Rep r)

newtype Star (f :: Type -> Type) d c #

Lift a Functor into a Profunctor (forwards).

Constructors

Star 

Fields

Instances
Functor f => Representable (Star f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Rep (Star f) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Star f) c) -> Star f d c #

Applicative f => Choice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Star f a b -> Star f (Either a c) (Either b c) #

right' :: Star f a b -> Star f (Either c a) (Either c b) #

Traversable f => Cochoice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Star f (Either a d) (Either b d) -> Star f a b #

unright :: Star f (Either d a) (Either d b) -> Star f a b #

Distributive f => Closed (Star f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Star f a b -> Star f (x -> a) (x -> b) #

Functor m => Strong (Star m) 
Instance details

Defined in Data.Profunctor.Strong

Methods

first' :: Star m a b -> Star m (a, c) (b, c) #

second' :: Star m a b -> Star m (c, a) (c, b) #

Functor f => Profunctor (Star f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

(#.) :: Coercible c b => q b c -> Star f a b -> Star f a c #

(.#) :: Coercible b a => Star f b c -> q a b -> Star f a c #

Functor f => Sieve (Star f) f 
Instance details

Defined in Data.Profunctor.Sieve

Methods

sieve :: Star f a b -> a -> f b #

Monad f => Category (Star f :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Types

Methods

id :: Star f a a #

(.) :: Star f b c -> Star f a b -> Star f a c #

Monad f => Monad (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

(>>=) :: Star f a a0 -> (a0 -> Star f a b) -> Star f a b #

(>>) :: Star f a a0 -> Star f a b -> Star f a b #

return :: a0 -> Star f a a0 #

fail :: String -> Star f a a0 #

Functor f => Functor (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (a0 -> b) -> Star f a a0 -> Star f a b #

(<$) :: a0 -> Star f a b -> Star f a a0 #

Applicative f => Applicative (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Star f a a0 #

(<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b #

liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c #

(*>) :: Star f a a0 -> Star f a b -> Star f a b #

(<*) :: Star f a a0 -> Star f a b -> Star f a a0 #

Distributive f => Distributive (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

distribute :: Functor f0 => f0 (Star f a a0) -> Star f a (f0 a0) #

collect :: Functor f0 => (a0 -> Star f a b) -> f0 a0 -> Star f a (f0 b) #

distributeM :: Monad m => m (Star f a a0) -> Star f a (m a0) #

collectM :: Monad m => (a0 -> Star f a b) -> m a0 -> Star f a (m b) #

Contravariant f => Contravariant (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

contramap :: (a0 -> b) -> Star f a b -> Star f a a0 #

(>$) :: b -> Star f a b -> Star f a a0 #

Alternative f => Alternative (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

empty :: Star f a a0 #

(<|>) :: Star f a a0 -> Star f a a0 -> Star f a a0 #

some :: Star f a a0 -> Star f a [a0] #

many :: Star f a a0 -> Star f a [a0] #

MonadPlus f => MonadPlus (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

mzero :: Star f a a0 #

mplus :: Star f a a0 -> Star f a a0 -> Star f a a0 #

Apply f => Apply (Star f a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Types

Methods

(<.>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b #

(.>) :: Star f a a0 -> Star f a b -> Star f a b #

(<.) :: Star f a a0 -> Star f a b -> Star f a a0 #

liftF2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c #

type Rep (Star f) 
Instance details

Defined in Data.Profunctor.Rep

type Rep (Star f) = f

newtype Costar (f :: Type -> Type) d c #

Lift a Functor into a Profunctor (backwards).

Constructors

Costar 

Fields

Instances
Contravariant f => Bifunctor (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Optic.Types

Methods

bimap :: (a -> b) -> (c -> d) -> Costar f a c -> Costar f b d #

first :: (a -> b) -> Costar f a c -> Costar f b c #

second :: (b -> c) -> Costar f a b -> Costar f a c #

Functor f => Corepresentable (Costar f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep (Costar f) :: Type -> Type #

Methods

cotabulate :: (Corep (Costar f) d -> c) -> Costar f d c #

Coapplicative f => Choice (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Optic.Types

Methods

left' :: Costar f a b -> Costar f (Either a c) (Either b c) #

right' :: Costar f a b -> Costar f (Either c a) (Either c b) #

Applicative f => Cochoice (Costar f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Costar f (Either a d) (Either b d) -> Costar f a b #

unright :: Costar f (Either d a) (Either d b) -> Costar f a b #

Functor f => Closed (Costar f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Costar f a b -> Costar f (x -> a) (x -> b) #

Functor f => Costrong (Costar f) 
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Costar f (a, d) (b, d) -> Costar f a b #

unsecond :: Costar f (d, a) (d, b) -> Costar f a b #

Functor f => Profunctor (Costar f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

(#.) :: Coercible c b => q b c -> Costar f a b -> Costar f a c #

(.#) :: Coercible b a => Costar f b c -> q a b -> Costar f a c #

Functor f => Cosieve (Costar f) f 
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: Costar f a b -> f a -> b #

Monad (Costar f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

(>>=) :: Costar f a a0 -> (a0 -> Costar f a b) -> Costar f a b #

(>>) :: Costar f a a0 -> Costar f a b -> Costar f a b #

return :: a0 -> Costar f a a0 #

fail :: String -> Costar f a a0 #

Functor (Costar f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (a0 -> b) -> Costar f a a0 -> Costar f a b #

(<$) :: a0 -> Costar f a b -> Costar f a a0 #

Applicative (Costar f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Costar f a a0 #

(<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b #

liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c #

(*>) :: Costar f a a0 -> Costar f a b -> Costar f a b #

(<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 #

Distributive (Costar f d) 
Instance details

Defined in Data.Profunctor.Types

Methods

distribute :: Functor f0 => f0 (Costar f d a) -> Costar f d (f0 a) #

collect :: Functor f0 => (a -> Costar f d b) -> f0 a -> Costar f d (f0 b) #

distributeM :: Monad m => m (Costar f d a) -> Costar f d (m a) #

collectM :: Monad m => (a -> Costar f d b) -> m a -> Costar f d (m b) #

Apply (Costar f a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Types

Methods

(<.>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b #

(.>) :: Costar f a a0 -> Costar f a b -> Costar f a b #

(<.) :: Costar f a a0 -> Costar f a b -> Costar f a a0 #

liftF2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c #

type Corep (Costar f) 
Instance details

Defined in Data.Profunctor.Rep

type Corep (Costar f) = f

newtype Tagged (s :: k) b :: forall k. k -> Type -> Type #

A Tagged s b value is a value b 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 Tagged s b can't try to use the argument s 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.

Constructors

Tagged 

Fields

Instances
Bitraversable (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Tagged a b -> f (Tagged c d) #

Bifoldable (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

bifold :: Monoid m => Tagged m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Tagged a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Tagged a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Tagged a b -> c #

Bifunctor (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

bimap :: (a -> b) -> (c -> d) -> Tagged a c -> Tagged b d #

first :: (a -> b) -> Tagged a c -> Tagged b c #

second :: (b -> c) -> Tagged a b -> Tagged a c #

Eq2 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Tagged a c -> Tagged b d -> Bool #

Ord2 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Tagged a c -> Tagged b d -> Ordering #

Read2 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Tagged a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Tagged a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Tagged a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Tagged a b] #

Show2 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Tagged a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Tagged a b] -> ShowS #

Corepresentable (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep Tagged :: Type -> Type #

Methods

cotabulate :: (Corep Tagged d -> c) -> Tagged d c #

Choice (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Tagged a b -> Tagged (Either a c) (Either b c) #

right' :: Tagged a b -> Tagged (Either c a) (Either c b) #

Closed (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Tagged a b -> Tagged (x -> a) (x -> b) #

Costrong (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Tagged (a, d) (b, d) -> Tagged a b #

unsecond :: Tagged (d, a) (d, b) -> Tagged a b #

Profunctor (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d #

lmap :: (a -> b) -> Tagged b c -> Tagged a c #

rmap :: (b -> c) -> Tagged a b -> Tagged a c #

(#.) :: Coercible c b => q b c -> Tagged a b -> Tagged a c #

(.#) :: Coercible b a => Tagged b c -> q a b -> Tagged a c #

Bitraversable1 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Tagged a c -> f (Tagged b d) #

bisequence1 :: Apply f => Tagged (f a) (f b) -> f (Tagged a b) #

Bifoldable1 (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

bifold1 :: Semigroup m => Tagged m m -> m #

bifoldMap1 :: Semigroup m => (a -> m) -> (b -> m) -> Tagged a b -> m #

Biapply (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<<.>>) :: Tagged (a -> b) (c -> d) -> Tagged a c -> Tagged b d #

(.>>) :: Tagged a b -> Tagged c d -> Tagged c d #

(<<.) :: Tagged a b -> Tagged c d -> Tagged a b #

Cosieve (Tagged :: Type -> Type -> Type) (Proxy :: Type -> Type) 
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: Tagged a b -> Proxy a -> b #

Generic1 (Tagged s :: Type -> Type) 
Instance details

Defined in Data.Tagged

Associated Types

type Rep1 (Tagged s) :: k -> Type #

Methods

from1 :: Tagged s a -> Rep1 (Tagged s) a #

to1 :: Rep1 (Tagged s) a -> Tagged s a #

Monad (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

(>>=) :: Tagged s a -> (a -> Tagged s b) -> Tagged s b #

(>>) :: Tagged s a -> Tagged s b -> Tagged s b #

return :: a -> Tagged s a #

fail :: String -> Tagged s a #

Functor (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

fmap :: (a -> b) -> Tagged s a -> Tagged s b #

(<$) :: a -> Tagged s b -> Tagged s a #

Applicative (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

pure :: a -> Tagged s a #

(<*>) :: Tagged s (a -> b) -> Tagged s a -> Tagged s b #

liftA2 :: (a -> b -> c) -> Tagged s a -> Tagged s b -> Tagged s c #

(*>) :: Tagged s a -> Tagged s b -> Tagged s b #

(<*) :: Tagged s a -> Tagged s b -> Tagged s a #

Foldable (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

fold :: Monoid m => Tagged s m -> m #

foldMap :: Monoid m => (a -> m) -> Tagged s a -> m #

foldr :: (a -> b -> b) -> b -> Tagged s a -> b #

foldr' :: (a -> b -> b) -> b -> Tagged s a -> b #

foldl :: (b -> a -> b) -> b -> Tagged s a -> b #

foldl' :: (b -> a -> b) -> b -> Tagged s a -> b #

foldr1 :: (a -> a -> a) -> Tagged s a -> a #

foldl1 :: (a -> a -> a) -> Tagged s a -> a #

toList :: Tagged s a -> [a] #

null :: Tagged s a -> Bool #

length :: Tagged s a -> Int #

elem :: Eq a => a -> Tagged s a -> Bool #

maximum :: Ord a => Tagged s a -> a #

minimum :: Ord a => Tagged s a -> a #

sum :: Num a => Tagged s a -> a #

product :: Num a => Tagged s a -> a #

Traversable (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

traverse :: Applicative f => (a -> f b) -> Tagged s a -> f (Tagged s b) #

sequenceA :: Applicative f => Tagged s (f a) -> f (Tagged s a) #

mapM :: Monad m => (a -> m b) -> Tagged s a -> m (Tagged s b) #

sequence :: Monad m => Tagged s (m a) -> m (Tagged s a) #

Distributive (Tagged t) 
Instance details

Defined in Data.Distributive

Methods

distribute :: Functor f => f (Tagged t a) -> Tagged t (f a) #

collect :: Functor f => (a -> Tagged t b) -> f a -> Tagged t (f b) #

distributeM :: Monad m => m (Tagged t a) -> Tagged t (m a) #

collectM :: Monad m => (a -> Tagged t b) -> m a -> Tagged t (m b) #

Representable (Tagged t) 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep (Tagged t) :: Type #

Methods

tabulate :: (Rep (Tagged t) -> a) -> Tagged t a #

index :: Tagged t a -> Rep (Tagged t) -> a #

Eq1 (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

liftEq :: (a -> b -> Bool) -> Tagged s a -> Tagged s b -> Bool #

Ord1 (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

liftCompare :: (a -> b -> Ordering) -> Tagged s a -> Tagged s b -> Ordering #

Read1 (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Tagged s a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Tagged s a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Tagged s a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Tagged s a] #

Show1 (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tagged s a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tagged s a] -> ShowS #

Coapplicative (Tagged k) 
Instance details

Defined in Control.Coapplicative

Methods

copure :: Tagged k a -> a #

Coapply (Tagged k) 
Instance details

Defined in Data.Functor.Coapply

Methods

coapply :: Tagged k (a + b) -> Tagged k a + Tagged k b #

Distributive1 (Tagged t) 
Instance details

Defined in Data.Functor.Coapply

Methods

distribute1 :: Coapply f => f (Tagged t a) -> Tagged t (f a) #

collect1 :: Coapply f => (a -> Tagged t b) -> f a -> Tagged t (f b) #

Comonad (Tagged s) 
Instance details

Defined in Control.Comonad

Methods

extract :: Tagged s a -> a #

duplicate :: Tagged s a -> Tagged s (Tagged s a) #

extend :: (Tagged s a -> b) -> Tagged s a -> Tagged s b #

Traversable1 (Tagged a) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a0 -> f b) -> Tagged a a0 -> f (Tagged a b) #

sequence1 :: Apply f => Tagged a (f b) -> f (Tagged a b) #

Foldable1 (Tagged a) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m => Tagged a m -> m #

foldMap1 :: Semigroup m => (a0 -> m) -> Tagged a a0 -> m #

toNonEmpty :: Tagged a a0 -> NonEmpty a0 #

Apply (Tagged a) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Tagged a (a0 -> b) -> Tagged a a0 -> Tagged a b #

(.>) :: Tagged a a0 -> Tagged a b -> Tagged a b #

(<.) :: Tagged a a0 -> Tagged a b -> Tagged a a0 #

liftF2 :: (a0 -> b -> c) -> Tagged a a0 -> Tagged a b -> Tagged a c #

Bind (Tagged a) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Tagged a a0 -> (a0 -> Tagged a b) -> Tagged a b #

join :: Tagged a (Tagged a a0) -> Tagged a a0 #

Bounded b => Bounded (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

minBound :: Tagged s b #

maxBound :: Tagged s b #

Enum a => Enum (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

succ :: Tagged s a -> Tagged s a #

pred :: Tagged s a -> Tagged s a #

toEnum :: Int -> Tagged s a #

fromEnum :: Tagged s a -> Int #

enumFrom :: Tagged s a -> [Tagged s a] #

enumFromThen :: Tagged s a -> Tagged s a -> [Tagged s a] #

enumFromTo :: Tagged s a -> Tagged s a -> [Tagged s a] #

enumFromThenTo :: Tagged s a -> Tagged s a -> Tagged s a -> [Tagged s a] #

Eq b => Eq (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

(==) :: Tagged s b -> Tagged s b -> Bool #

(/=) :: Tagged s b -> Tagged s b -> Bool #

Floating a => Floating (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

pi :: Tagged s a #

exp :: Tagged s a -> Tagged s a #

log :: Tagged s a -> Tagged s a #

sqrt :: Tagged s a -> Tagged s a #

(**) :: Tagged s a -> Tagged s a -> Tagged s a #

logBase :: Tagged s a -> Tagged s a -> Tagged s a #

sin :: Tagged s a -> Tagged s a #

cos :: Tagged s a -> Tagged s a #

tan :: Tagged s a -> Tagged s a #

asin :: Tagged s a -> Tagged s a #

acos :: Tagged s a -> Tagged s a #

atan :: Tagged s a -> Tagged s a #

sinh :: Tagged s a -> Tagged s a #

cosh :: Tagged s a -> Tagged s a #

tanh :: Tagged s a -> Tagged s a #

asinh :: Tagged s a -> Tagged s a #

acosh :: Tagged s a -> Tagged s a #

atanh :: Tagged s a -> Tagged s a #

log1p :: Tagged s a -> Tagged s a #

expm1 :: Tagged s a -> Tagged s a #

log1pexp :: Tagged s a -> Tagged s a #

log1mexp :: Tagged s a -> Tagged s a #

Fractional a => Fractional (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

(/) :: Tagged s a -> Tagged s a -> Tagged s a #

recip :: Tagged s a -> Tagged s a #

fromRational :: Rational -> Tagged s a #

Integral a => Integral (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

quot :: Tagged s a -> Tagged s a -> Tagged s a #

rem :: Tagged s a -> Tagged s a -> Tagged s a #

div :: Tagged s a -> Tagged s a -> Tagged s a #

mod :: Tagged s a -> Tagged s a -> Tagged s a #

quotRem :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) #

divMod :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) #

toInteger :: Tagged s a -> Integer #

(Data s, Data b) => Data (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Tagged s b -> c (Tagged s b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tagged s b) #

toConstr :: Tagged s b -> Constr #

dataTypeOf :: Tagged s b -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Tagged s b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tagged s b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Tagged s b -> Tagged s b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tagged s b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tagged s b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tagged s b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tagged s b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged s b -> m (Tagged s b) #

Num a => Num (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

(+) :: Tagged s a -> Tagged s a -> Tagged s a #

(-) :: Tagged s a -> Tagged s a -> Tagged s a #

(*) :: Tagged s a -> Tagged s a -> Tagged s a #

negate :: Tagged s a -> Tagged s a #

abs :: Tagged s a -> Tagged s a #

signum :: Tagged s a -> Tagged s a #

fromInteger :: Integer -> Tagged s a #

Ord b => Ord (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

compare :: Tagged s b -> Tagged s b -> Ordering #

(<) :: Tagged s b -> Tagged s b -> Bool #

(<=) :: Tagged s b -> Tagged s b -> Bool #

(>) :: Tagged s b -> Tagged s b -> Bool #

(>=) :: Tagged s b -> Tagged s b -> Bool #

max :: Tagged s b -> Tagged s b -> Tagged s b #

min :: Tagged s b -> Tagged s b -> Tagged s b #

Read b => Read (Tagged s b) 
Instance details

Defined in Data.Tagged

Real a => Real (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

toRational :: Tagged s a -> Rational #

RealFloat a => RealFloat (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

floatRadix :: Tagged s a -> Integer #

floatDigits :: Tagged s a -> Int #

floatRange :: Tagged s a -> (Int, Int) #

decodeFloat :: Tagged s a -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Tagged s a #

exponent :: Tagged s a -> Int #

significand :: Tagged s a -> Tagged s a #

scaleFloat :: Int -> Tagged s a -> Tagged s a #

isNaN :: Tagged s a -> Bool #

isInfinite :: Tagged s a -> Bool #

isDenormalized :: Tagged s a -> Bool #

isNegativeZero :: Tagged s a -> Bool #

isIEEE :: Tagged s a -> Bool #

atan2 :: Tagged s a -> Tagged s a -> Tagged s a #

RealFrac a => RealFrac (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

properFraction :: Integral b => Tagged s a -> (b, Tagged s a) #

truncate :: Integral b => Tagged s a -> b #

round :: Integral b => Tagged s a -> b #

ceiling :: Integral b => Tagged s a -> b #

floor :: Integral b => Tagged s a -> b #

Show b => Show (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

showsPrec :: Int -> Tagged s b -> ShowS #

show :: Tagged s b -> String #

showList :: [Tagged s b] -> ShowS #

Ix b => Ix (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

range :: (Tagged s b, Tagged s b) -> [Tagged s b] #

index :: (Tagged s b, Tagged s b) -> Tagged s b -> Int #

unsafeIndex :: (Tagged s b, Tagged s b) -> Tagged s b -> Int

inRange :: (Tagged s b, Tagged s b) -> Tagged s b -> Bool #

rangeSize :: (Tagged s b, Tagged s b) -> Int #

unsafeRangeSize :: (Tagged s b, Tagged s b) -> Int

IsString a => IsString (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

fromString :: String -> Tagged s a #

Generic (Tagged s b) 
Instance details

Defined in Data.Tagged

Associated Types

type Rep (Tagged s b) :: Type -> Type #

Methods

from :: Tagged s b -> Rep (Tagged s b) x #

to :: Rep (Tagged s b) x -> Tagged s b #

Semigroup a => Semigroup (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

(<>) :: Tagged s a -> Tagged s a -> Tagged s a #

sconcat :: NonEmpty (Tagged s a) -> Tagged s a #

stimes :: Integral b => b -> Tagged s a -> Tagged s a #

(Semigroup a, Monoid a) => Monoid (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

mempty :: Tagged s a #

mappend :: Tagged s a -> Tagged s a -> Tagged s a #

mconcat :: [Tagged s a] -> Tagged s a #

Storable a => Storable (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

sizeOf :: Tagged s a -> Int #

alignment :: Tagged s a -> Int #

peekElemOff :: Ptr (Tagged s a) -> Int -> IO (Tagged s a) #

pokeElemOff :: Ptr (Tagged s a) -> Int -> Tagged s a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Tagged s a) #

pokeByteOff :: Ptr b -> Int -> Tagged s a -> IO () #

peek :: Ptr (Tagged s a) -> IO (Tagged s a) #

poke :: Ptr (Tagged s a) -> Tagged s a -> IO () #

Bits a => Bits (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

(.&.) :: Tagged s a -> Tagged s a -> Tagged s a #

(.|.) :: Tagged s a -> Tagged s a -> Tagged s a #

xor :: Tagged s a -> Tagged s a -> Tagged s a #

complement :: Tagged s a -> Tagged s a #

shift :: Tagged s a -> Int -> Tagged s a #

rotate :: Tagged s a -> Int -> Tagged s a #

zeroBits :: Tagged s a #

bit :: Int -> Tagged s a #

setBit :: Tagged s a -> Int -> Tagged s a #

clearBit :: Tagged s a -> Int -> Tagged s a #

complementBit :: Tagged s a -> Int -> Tagged s a #

testBit :: Tagged s a -> Int -> Bool #

bitSizeMaybe :: Tagged s a -> Maybe Int #

bitSize :: Tagged s a -> Int #

isSigned :: Tagged s a -> Bool #

shiftL :: Tagged s a -> Int -> Tagged s a #

unsafeShiftL :: Tagged s a -> Int -> Tagged s a #

shiftR :: Tagged s a -> Int -> Tagged s a #

unsafeShiftR :: Tagged s a -> Int -> Tagged s a #

rotateL :: Tagged s a -> Int -> Tagged s a #

rotateR :: Tagged s a -> Int -> Tagged s a #

popCount :: Tagged s a -> Int #

FiniteBits a => FiniteBits (Tagged s a) 
Instance details

Defined in Data.Tagged

NFData b => NFData (Tagged s b) 
Instance details

Defined in Data.Tagged

Methods

rnf :: Tagged s b -> () #

type Corep (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Rep

type Corep (Tagged :: Type -> Type -> Type) = (Proxy :: Type -> Type)
type Rep1 (Tagged s :: Type -> Type) 
Instance details

Defined in Data.Tagged

type Rep1 (Tagged s :: Type -> Type) = D1 (MetaData "Tagged" "Data.Tagged" "tagged-0.8.6-EiJ2F18RuD68LSMkg0Ly4r" True) (C1 (MetaCons "Tagged" PrefixI True) (S1 (MetaSel (Just "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Tagged t) 
Instance details

Defined in Data.Functor.Rep

type Rep (Tagged t) = ()
type Rep (Tagged s b) 
Instance details

Defined in Data.Tagged

type Rep (Tagged s b) = D1 (MetaData "Tagged" "Data.Tagged" "tagged-0.8.6-EiJ2F18RuD68LSMkg0Ly4r" True) (C1 (MetaCons "Tagged" PrefixI True) (S1 (MetaSel (Just "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 b)))

Index

data Index a b s Source #

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

dimap :: (a0 -> b) -> (c -> d) -> Index a b c -> Index a a0 d #

lmap :: (a0 -> b) -> Index a b c -> Index a a0 c #

rmap :: (b -> c) -> Index a a0 b -> Index a a0 c #

(#.) :: Coercible c b => q b c -> Index a a0 b -> Index a a0 c #

(.#) :: Coercible b a0 => Index a b c -> q a0 b -> Index a a0 c #

Functor (Index a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

fmap :: (a0 -> b0) -> Index a b a0 -> Index a b b0 #

(<$) :: a0 -> Index a b b0 -> Index a b a0 #

a ~ b => Foldable (Index a b) Source # 
Instance details

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 #

sum :: Num a0 => Index a b a0 -> a0 #

product :: Num a0 => Index a b a0 -> a0 #

Sieve (LensRep a b) (Index a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

sieve :: LensRep a b a0 b0 -> a0 -> Index a b b0 #

Sieve (IsoRep a b) (Index a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

sieve :: IsoRep a b a0 b0 -> a0 -> Index a b b0 #

Generic (Index a b s) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (Index a b s) :: Type -> Type #

Methods

from :: Index a b s -> Rep (Index a b s) x #

to :: Rep (Index a b s) x -> Index a b s #

type Rep (Index a b s) Source # 
Instance details

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))))

vals :: Index a b s -> b -> s Source #

info :: Index a b s -> a Source #

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

fmap :: (a0 -> b0) -> Coindex a b a0 -> Coindex a b b0 #

(<$) :: a0 -> Coindex a b b0 -> Coindex a b a0 #

a ~ b => Applicative (Coindex a b) Source # 
Instance details

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 # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

(<.>) :: Coindex a b (a0 -> b0) -> Coindex a b a0 -> Coindex a b b0 #

(.>) :: Coindex a b a0 -> Coindex a b b0 -> Coindex a b b0 #

(<.) :: Coindex a b a0 -> Coindex a b b0 -> Coindex a b a0 #

liftF2 :: (a0 -> b0 -> c) -> Coindex a b a0 -> Coindex a b b0 -> Coindex a b c #

Cosieve (GrateRep a b) (Coindex a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

cosieve :: GrateRep a b a0 b0 -> Coindex a b a0 -> b0 #

Cosieve (IsoRep a b) (Coindex a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

cosieve :: IsoRep a b a0 b0 -> Coindex a b a0 -> b0 #

Generic (Coindex a b s) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (Coindex a b s) :: Type -> Type #

Methods

from :: Coindex a b s -> Rep (Coindex a b s) x #

to :: Rep (Coindex a b s) x -> Coindex a b s #

type Rep (Coindex a b s) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Rep (Coindex a b s) = D1 (MetaData "Coindex" "Data.Profunctor.Optic.Carrier" "profunctor-optics-0.0.2-BQ5vHMWylUn3p9oJtWEgRF" True) (C1 (MetaCons "Coindex" PrefixI True) (S1 (MetaSel (Just "runCoindex") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ((s -> a) -> b))))

trivial :: Coindex a b a -> b Source #

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:

 Coindex mapWithKey .#. noindex map
   :: Monoid k =>
      Coindex (a -> b) (Map k (Map j a) -> Map k (Map j b)) k

coindex :: Functor f => s -> (a -> b) -> Coindex (f a) (f b) s Source #

(.#.) :: 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 #

Constructors

Conjoin 

Fields

Instances
Arrow (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

arr :: (b -> c) -> Conjoin j b c #

first :: Conjoin j b c -> Conjoin j (b, d) (c, d) #

second :: Conjoin j b c -> Conjoin j (d, b) (d, c) #

(***) :: Conjoin j b c -> Conjoin j b' c' -> Conjoin j (b, b') (c, c') #

(&&&) :: Conjoin j b c -> Conjoin j b c' -> Conjoin j b (c, c') #

ArrowChoice (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

left :: Conjoin j b c -> Conjoin j (Either b d) (Either c d) #

right :: Conjoin j b c -> Conjoin j (Either d b) (Either d c) #

(+++) :: Conjoin j b c -> Conjoin j b' c' -> Conjoin j (Either b b') (Either c c') #

(|||) :: Conjoin j b d -> Conjoin j c d -> Conjoin j (Either b c) d #

ArrowApply (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

app :: Conjoin j (Conjoin j b c, b) c #

ArrowLoop (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

loop :: Conjoin j (b, d) (c, d) -> Conjoin j b c #

Representable (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Rep (Conjoin j) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Conjoin j) c) -> Conjoin j d c #

Corepresentable (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Associated Types

type Corep (Conjoin j) :: Type -> Type #

Methods

cotabulate :: (Corep (Conjoin j) d -> c) -> Conjoin j d c #

Choice (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

left' :: Conjoin j a b -> Conjoin j (Either a c) (Either b c) #

right' :: Conjoin j a b -> Conjoin j (Either c a) (Either c b) #

Closed (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

closed :: Conjoin j a b -> Conjoin j (x -> a) (x -> b) #

Strong (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

first' :: Conjoin j a b -> Conjoin j (a, c) (b, c) #

second' :: Conjoin j a b -> Conjoin j (c, a) (c, b) #

Costrong (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

unfirst :: Conjoin j (a, d) (b, d) -> Conjoin j a b #

unsecond :: Conjoin j (d, a) (d, b) -> Conjoin j a b #

Profunctor (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

dimap :: (a -> b) -> (c -> d) -> Conjoin j b c -> Conjoin j a d #

lmap :: (a -> b) -> Conjoin j b c -> Conjoin j a c #

rmap :: (b -> c) -> Conjoin j a b -> Conjoin j a c #

(#.) :: Coercible c b => q b c -> Conjoin j a b -> Conjoin j a c #

(.#) :: Coercible b a => Conjoin j b c -> q a b -> Conjoin j a c #

Category (Conjoin j :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

id :: Conjoin j a a #

(.) :: Conjoin j b c -> Conjoin j a b -> Conjoin j a c #

Cosieve (Conjoin j) ((,) j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

cosieve :: Conjoin j a b -> (j, a) -> b #

Sieve (Conjoin j) ((->) j :: Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

sieve :: Conjoin j a b -> a -> j -> b #

Monad (Conjoin j a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

(>>=) :: Conjoin j a a0 -> (a0 -> Conjoin j a b) -> Conjoin j a b #

(>>) :: Conjoin j a a0 -> Conjoin j a b -> Conjoin j a b #

return :: a0 -> Conjoin j a a0 #

fail :: String -> Conjoin j a a0 #

Functor (Conjoin j a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

fmap :: (a0 -> b) -> Conjoin j a a0 -> Conjoin j a b #

(<$) :: a0 -> Conjoin j a b -> Conjoin j a a0 #

MonadFix (Conjoin j a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

mfix :: (a0 -> Conjoin j a a0) -> Conjoin j a a0 #

Applicative (Conjoin j a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

pure :: a0 -> Conjoin j a a0 #

(<*>) :: Conjoin j a (a0 -> b) -> Conjoin j a a0 -> Conjoin j a b #

liftA2 :: (a0 -> b -> c) -> Conjoin j a a0 -> Conjoin j a b -> Conjoin j a c #

(*>) :: Conjoin j a a0 -> Conjoin j a b -> Conjoin j a b #

(<*) :: Conjoin j a a0 -> Conjoin j a b -> Conjoin j a a0 #

Apply (Conjoin j a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

Methods

(<.>) :: Conjoin j a (a0 -> b) -> Conjoin j a a0 -> Conjoin j a b #

(.>) :: Conjoin j a a0 -> Conjoin j a b -> Conjoin j a b #

(<.) :: Conjoin j a a0 -> Conjoin j a b -> Conjoin j a a0 #

liftF2 :: (a0 -> b -> c) -> Conjoin j a a0 -> Conjoin j a b -> Conjoin j a c #

type Rep (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Rep (Conjoin j) = ((->) j :: Type -> Type)
type Corep (Conjoin j) Source # 
Instance details

Defined in Data.Profunctor.Optic.Carrier

type Corep (Conjoin j) = (,) j