| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Testing.Laws.Run
Description
Checking laws stated as code (Proarrow.Tools.Laws) in a Testable category: testLaws
runs each law with random objects for its variables and random arrows for the ones it asks for,
and compares both sides.
The endpoints of a law's equation are built inside the law, so their TestOb cannot be listed
up front. Instead the law is run in TESTED k, whose objects are built from leaves by the
structures' object formers; there an object's Ob is Tested, which rebuilds the TestOb of
the object of k it stands for from the Witnesses passed at run time: one Witness per
structure in the law's list, e.g. a WithTestOb2 for Monoidal.
A structure this module does not cover can be added from outside it, in the same way as the ones here:
- a former for each new kind of object (an open data family, or one of the free category's),
with a
Testedinstance giving itsUntestand rebuilding itsObandTestOb; - a
Witnessinstance for the structure, holding howTestObis closed under its formers; - the structure's class instance for
TESTED, whose arrows describe themselves (primfor a named arrow,app,apps,infixlDoc,infixrDocfor operations on arrows).
testProLaws checks the laws of a profunctor class (Proarrow.Tools.Laws ProLaws) the
same way, with the profunctor interpreted as TestedP, whose elements describe themselves like
the arrows of TESTED do (TestedArr is TestedP at the hom profunctor). Its domain and
codomain each get their own Witnesses. An object former that crosses from one to the other,
like RepF for p , carries the witnesses of the side it comes from in its structure's
% bWitness (RepresentedBy, CorepresentedBy). The laws of Proadjunction and
Procomonad build composites whose middle object is only known to be an object; the
runner makes it a leaf, which needs TestOb to follow from Ob.
Synopsis
- testLaws :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => String -> Witnesses cs k -> TestTree
- testLawsWith :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => Property (Some k) -> String -> Witnesses cs k -> TestTree
- testLawsWithOptions :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => TestOptions -> Property (Some k) -> String -> Witnesses cs k -> TestTree
- testProLaws :: forall {j} {k} (csj :: [Kind -> Constraint]) (csk :: [Kind -> Constraint]) (cl :: (TESTED csj j +-> TESTED csk k) -> Constraint) (p :: j +-> k). (ProLaws cl, TestableProfunctor p, cl (TestedP p :: TESTED csk k -> TESTED csj j -> Type)) => TestOptions -> (forall i. Testable i => Gen (Some i)) -> String -> Witnesses csj j -> Witnesses csk k -> TestTree
- data family Witness (c :: Kind -> Constraint) k
- data Witnesses (cs :: [Kind -> Constraint]) k where
- WNil :: forall k. Witnesses ('[] :: [Kind -> Constraint]) k
- (:&) :: forall (c :: Kind -> Constraint) k (cs1 :: [Kind -> Constraint]). Witness c k -> Witnesses cs1 k -> Witnesses (c ': cs1) k
- class HasWitness (c :: Kind -> Constraint) (cs :: [Kind -> Constraint]) where
- data TESTED (cs :: [Kind -> Constraint]) k = TLeaf k
- class Tested (a :: TESTED cs k) where
- untestOb2 :: forall {cs1 :: [Kind -> Constraint]} {k1} {cs2 :: [Kind -> Constraint]} {k2} (a :: TESTED cs2 k2) (b :: TESTED cs1 k1) r. (Tested a, Tested b) => ((Ob (Untest a), Ob (Untest b)) => r) -> r
- untestOb3 :: forall {cs1 :: [Kind -> Constraint]} {k1} {cs2 :: [Kind -> Constraint]} {k2} {cs3 :: [Kind -> Constraint]} {k3} (a :: TESTED cs3 k3) (b :: TESTED cs1 k1) (c :: TESTED cs2 k2) r. (Tested a, Tested b, Tested c) => ((Ob (Untest a), Ob (Untest b), Ob (Untest c)) => r) -> r
- untestTestOb2 :: forall {cs :: [Kind -> Constraint]} {k} (a :: TESTED cs k) (b :: TESTED cs k) r. (Tested a, Tested b) => Witnesses cs k -> ((TestOb (Untest a), TestOb (Untest b)) => r) -> r
- type TestedArr = TestedP (Hom k) :: TESTED cs k -> TESTED cs k -> Type
- pattern TestedArr :: forall cs k a b. () => (Tested a, Tested b) => Doc -> (Untest a ~> Untest b) -> TestedArr a b
- data TestedP (p :: j +-> k) (a :: TESTED csk k) (b :: TESTED csj j) where
- data family RepF (p :: j +-> k) (b :: TESTED csj j) :: o
- class RepresentedBy (csj :: [Kind -> Constraint]) (p :: j +-> k) k'
- data family CorepF (p :: j +-> k) (a :: TESTED csk k) :: o
- class CorepresentedBy (csk :: [Kind -> Constraint]) (p :: j +-> k) j'
- type Doc = Int -> ShowS
- prim :: forall {csk :: [Kind -> Constraint]} {k} {csj :: [Kind -> Constraint]} {j} (a :: TESTED csk k) (b :: TESTED csj j) p. (Tested a, Tested b) => String -> p (Untest a) (Untest b) -> TestedP p a b
- atom :: String -> Doc
- app :: String -> Doc -> Doc
- apps :: String -> [Doc] -> Doc
- infixlDoc :: Int -> String -> Doc -> Doc -> Doc
- infixrDoc :: Int -> String -> Doc -> Doc -> Doc
Documentation
testLaws :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => String -> Witnesses cs k -> TestTree Source Github #
testLawsWith :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => Property (Some k) -> String -> Witnesses cs k -> TestTree Source Github #
testLaws with the objects for the variables drawn from the given generator, e.g.
genObSmall where the laws build large objects like exponentials.
testLawsWithOptions :: forall (cs :: [Kind -> Constraint]) k. (Laws cs, Testable k, All cs (TESTED cs k)) => TestOptions -> Property (Some k) -> String -> Witnesses cs k -> TestTree Source Github #
testLawsWith with falsify options applied to each law.
testProLaws :: forall {j} {k} (csj :: [Kind -> Constraint]) (csk :: [Kind -> Constraint]) (cl :: (TESTED csj j +-> TESTED csk k) -> Constraint) (p :: j +-> k). (ProLaws cl, TestableProfunctor p, cl (TestedP p :: TESTED csk k -> TESTED csj j -> Type)) => TestOptions -> (forall i. Testable i => Gen (Some i)) -> String -> Witnesses csj j -> Witnesses csk k -> TestTree Source Github #
Check the laws of for the profunctor ProLaws cp, one property per law: run each
law with p interpreted as TestedP p, its elements drawn by genProfunctorElt (each picks
its two object variables), the other variables of a ProLaw drawn along the chain
e and ~> c ~> ab where those hom-sets are non-empty, and random arrows
for the ones it asks for. The two ~> d ~> fWitnesses are for the domain j and the codomain
k of p, the TestOptions apply to each law's property, and the other variables are drawn from
the given generator of objects, e.g. genSomeSmall where the laws tensor several objects
together.
Witnesses
data family Witness (c :: Kind -> Constraint) k Source Github #
How TestOb is closed under the object formers of the structure c, for the category k.
Structures without formers of their own have a witness that holds nothing.
Instances
data Witnesses (cs :: [Kind -> Constraint]) k where Source Github #
One Witness for each structure in cs, in the same order.
Constructors
| WNil :: forall k. Witnesses ('[] :: [Kind -> Constraint]) k | |
| (:&) :: forall (c :: Kind -> Constraint) k (cs1 :: [Kind -> Constraint]). Witness c k -> Witnesses cs1 k -> Witnesses (c ': cs1) k infixr 5 |
class HasWitness (c :: Kind -> Constraint) (cs :: [Kind -> Constraint]) where Source Github #
Look up the witness for the structure c.
Instances
| HasWitness c (c ': cs) Source Github # | |
| HasWitness c cs => HasWitness c (d ': cs) Source Github # | |
Interpreting with testable objects
data TESTED (cs :: [Kind -> Constraint]) k Source Github #
Objects of k built from leaves by the structures' object formers. Checking a law
interprets it here rather than in k itself: an object's Ob is then Tested, which
recovers the TestOb of the object of k it stands for (Untest) from the Witnesses for
the structures cs, supplied at run time.
The only constructor is the leaf. Compound objects use the free category's formers, which are
open data families of any kind (**!, *!, DualF, ...), so a new
structure brings its own former and its own Tested instance.
Constructors
| TLeaf k |
Instances
| (Testable k, Monoidal k, TestOb (Unit :: k)) => Tested (UnitF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (Testable k, HasInitialObject k, TestOb (InitialObject :: k)) => Tested (InitF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (Testable k, HasTerminalObject k, TestOb (TerminalObject :: k)) => Tested (TermF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness Dialogue cs, Dialogue k, Tested a) => Tested (DualF a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Monoidal cs, Monoidal k, Tested a, Tested b) => Tested (a **! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Closed cs, Closed k, Tested a, Tested b) => Tested (a --> b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness HasBinaryCoproducts cs, HasBinaryCoproducts k, Tested a, Tested b) => Tested (a + b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness HasBinaryProducts cs, HasBinaryProducts k, Tested a, Tested b) => Tested (a *! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness (CorepresentedBy csk p) csj, Corepresentable p, Tested a) => Tested (CorepF p a :: TESTED csj j) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness (RepresentedBy csj p) csk, Representable p, Tested b) => Tested (RepF p b :: TESTED csk k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Monoidal cs, Testable k, Monoidal k, TestOb (Unit :: k)) => Monoidal (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
Methods withOb2 :: forall (a :: TESTED cs k) (b :: TESTED cs k) r. (Ob a, Ob b) => (Ob (a ** b) => r) -> r Github # leftUnitor :: forall (a :: TESTED cs k). Ob a => ((Unit :: TESTED cs k) ** a) ~> a Github # leftUnitorInv :: forall (a :: TESTED cs k). Ob a => a ~> ((Unit :: TESTED cs k) ** a) Github # rightUnitor :: forall (a :: TESTED cs k). Ob a => (a ** (Unit :: TESTED cs k)) ~> a Github # rightUnitorInv :: forall (a :: TESTED cs k). Ob a => a ~> (a ** (Unit :: TESTED cs k)) Github # associator :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => ((a ** b) ** c) ~> (a ** (b ** c)) Github # associatorInv :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => (a ** (b ** c)) ~> ((a ** b) ** c) Github # | |||||
| (HasWitness Monoidal cs, Testable k, SymMonoidal k, TestOb (Unit :: k)) => SymMonoidal (TESTED cs k) Source Github # | |||||
| (HasWitness Monoidal cs, HasWitness Closed cs, Testable k, Closed k, TestOb (Unit :: k)) => Closed (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods withObExp :: forall (a :: TESTED cs k) (b :: TESTED cs k) r. (Ob a, Ob b) => (Ob (a ~~> b) => r) -> r Github # curry :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b) => ((a ** b) ~> c) -> a ~> (b ~~> c) Github # apply :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => ((a ~~> b) ** a) ~> b Github # (^^^) :: forall (a :: TESTED cs k) (b :: TESTED cs k) (x :: TESTED cs k) (y :: TESTED cs k). (b ~> y) -> (x ~> a) -> (a ~~> b) ~> (x ~~> y) Github # | |||||
| (HasWitness Monoidal cs, HasWitness Closed cs, HasWitness Dialogue cs, Testable k, CompactClosed k, TestOb (Unit :: k)) => CompactClosed (TESTED cs k) Source Github # | |||||
| (HasWitness Monoidal cs, Testable k, CopyDiscard k, TestOb (Unit :: k)) => CopyDiscard (TESTED cs k) Source Github # | Copying and discarding in the category the objects stand for. | ||||
| (HasWitness Monoidal cs, HasWitness Dialogue cs, Testable k, Dialogue k, TestOb (Unit :: k)) => Dialogue (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods withObDual :: forall (a :: TESTED cs k) r. Ob a => (Ob (Dual a) => r) -> r Github # dual :: forall (a :: TESTED cs k) (b :: TESTED cs k). (a ~> b) -> Dual b ~> Dual a Github # linDist :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => ((a ** b) ~> Dual c) -> a ~> Dual (b ** c) Github # linDistInv :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => (a ~> Dual (b ** c)) -> (a ** b) ~> Dual c Github # doubleNegInv :: forall (a :: TESTED cs k). Ob a => a ~> Dual (Dual a) Github # | |||||
| (HasWitness Monoidal cs, HasWitness HasBinaryCoproducts cs, Testable k, Distributive k, TestOb (Unit :: k), TestOb (InitialObject :: k)) => Distributive (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods distL :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Github # distR :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Github # absorbL :: forall (a :: TESTED cs k). Ob a => (a ** (InitialObject :: TESTED cs k)) ~> (InitialObject :: TESTED cs k) Github # absorbR :: forall (a :: TESTED cs k). Ob a => ((InitialObject :: TESTED cs k) ** a) ~> (InitialObject :: TESTED cs k) Github # | |||||
| (HasWitness Monoidal cs, HasWitness Dialogue cs, Testable k, IsoMix k, TestOb (Unit :: k)) => IsoMix (TESTED cs k) Source Github # | |||||
| (HasWitness Monoidal cs, HasWitness Closed cs, HasWitness Dialogue cs, Testable k, StarAutonomous k, TestOb (Unit :: k)) => StarAutonomous (TESTED cs k) Source Github # | |||||
| (HasWitness HasBinaryCoproducts cs, HasBinaryCoproducts k) => HasBinaryCoproducts (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods withObCoprod :: forall (a :: TESTED cs k) (b :: TESTED cs k) r. (Ob a, Ob b) => (Ob (a || b) => r) -> r Github # lft :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => a ~> (a || b) Github # rgt :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => b ~> (a || b) Github # (|||) :: forall (x :: TESTED cs k) (a :: TESTED cs k) (y :: TESTED cs k). (x ~> a) -> (y ~> a) -> (x || y) ~> a Github # (+++) :: forall (a :: TESTED cs k) (b :: TESTED cs k) (x :: TESTED cs k) (y :: TESTED cs k). (a ~> x) -> (b ~> y) -> (a || b) ~> (x || y) Github # | |||||
| (Testable k, HasInitialObject k, TestOb (InitialObject :: k)) => HasInitialObject (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| CategoryOf k => CategoryOf (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness HasBinaryProducts cs, HasBinaryProducts k) => HasBinaryProducts (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods withObProd :: forall (a :: TESTED cs k) (b :: TESTED cs k) r. (Ob a, Ob b) => (Ob (a && b) => r) -> r Github # fst :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => (a && b) ~> a Github # snd :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => (a && b) ~> b Github # (&&&) :: forall (a :: TESTED cs k) (x :: TESTED cs k) (y :: TESTED cs k). (a ~> x) -> (a ~> y) -> a ~> (x && y) Github # (***) :: forall (a :: TESTED cs k) (b :: TESTED cs k) (x :: TESTED cs k) (y :: TESTED cs k). (a ~> x) -> (b ~> y) -> (a && b) ~> (x && y) Github # | |||||
| (Testable k, HasTerminalObject k, TestOb (TerminalObject :: k)) => HasTerminalObject (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| CategoryOf k => Labelled (TESTED cs k) Source Github # | |||||
| (HasWitness Monoidal cs, Testable k, SymMonoidal k, Supplies CocommutativeComonoid k, TestOb (Unit :: k), Tested a) => CocommutativeComonoid (a :: TESTED cs k) Source Github # | The comonoids of a category that supplies cocommutative ones are cocommutative. | ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Monoidal cs, Testable k, SymMonoidal k, Supplies CommutativeMonoid k, TestOb (Unit :: k), Tested a) => CommutativeMonoid (a :: TESTED cs k) Source Github # | The monoids of a category that supplies commutative ones are commutative. | ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Monoidal cs, Testable k, Monoidal k, Supplies Comonoid k, TestOb (Unit :: k), Tested a) => Comonoid (a :: TESTED cs k) Source Github # | Every object is a comonoid when the category supplies them. | ||||
| (HasWitness Monoidal cs, Testable k, Monoidal k, Supplies Monoid k, TestOb (Unit :: k), Tested a) => Monoid (a :: TESTED cs k) Source Github # | Every object is a monoid when the category supplies them, with the monoid of the object it stands for. | ||||
| (HasWitness Monoidal cs, Testable k, Monoidal k, Costrong (Tensor :: k -> (k, k) -> Type) p, TestOb (Unit :: k)) => Costrong (Tensor :: TESTED cs k -> (TESTED cs k, TESTED cs k) -> Type) (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # |
| ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (HasWitness Monoidal cs, Testable k, Monoidal k, Strong (Tensor :: k -> (k, k) -> Type) p, TestOb (Unit :: k)) => Strong (Tensor :: TESTED cs k -> (TESTED cs k, TESTED cs k) -> Type) (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # |
| ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| Finitary p => Finitary (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods size :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => Natural Github # toIndex :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => TestedP p a b -> Natural Github # fromIndex :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => Natural -> TestedP p a b Github # elements :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => [TestedP p a b] Github # | |||||
| (HasWitness Monoidal csj, HasWitness Monoidal csk, Testable j, Testable k, MonoidalProfunctor p, TestOb (Unit :: j), TestOb (Unit :: k)) => MonoidalProfunctor (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |||||
| Profunctor p => Profunctor (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods dimap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j) (d :: TESTED csj j). (c ~> a) -> (b ~> d) -> TestedP p a b -> TestedP p c d Github # lmap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j). (c ~> a) -> TestedP p a b -> TestedP p c b Github # rmap :: forall (b :: TESTED csj j) (d :: TESTED csj j) (a :: TESTED csk k). (b ~> d) -> TestedP p a b -> TestedP p a d Github # (\\) :: forall (a :: TESTED csk k) (b :: TESTED csj j) r. ((Ob a, Ob b) => r) -> TestedP p a b -> r Github # | |||||
| (HasWitness (CorepresentedBy csk p) csj, Corepresentable p) => Corepresentable (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods coindex :: forall (a :: TESTED csk k) (b :: TESTED csj j). TestedP p a b -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> b Github # cotabulate :: forall (a :: TESTED csk k) (b :: TESTED csj j). Ob a => (((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> b) -> TestedP p a b Github # corepMap :: forall (a :: TESTED csk k) (b :: TESTED csk k). (a ~> b) -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% b) Github # corepUniv :: forall (a :: TESTED csk k). Ob a => TestedP p a ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) Github # | |||||
| (HasWitness (RepresentedBy csj p) csk, Representable p) => Representable (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods index :: forall (a :: TESTED csk k) (b :: TESTED csj j). TestedP p a b -> a ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b) Github # tabulate :: forall (b :: TESTED csj j) (a :: TESTED csk k). Ob b => (a ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b)) -> TestedP p a b Github # repMap :: forall (a :: TESTED csj j) (b :: TESTED csj j). (a ~> b) -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b) Github # repUniv :: forall (a :: TESTED csj j). Ob a => TestedP p ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) a Github # | |||||
| (Proadjunction p q, Testable j, Testable k, TestObIsOb j, TestObIsOb k) => Proadjunction (TestedP p :: TESTED csk k -> TESTED csj j -> Type) (TestedP q :: TESTED csj j -> TESTED csk k -> Type) Source Github # | The adjunction of the profunctors the objects stand for. The middle object of the | ||||
Defined in Proarrow.Testing.Laws.Run Methods unit :: forall (a :: TESTED csj j). Ob a => ((TestedP q :: TESTED csj j -> TESTED csk k -> Type) :.: (TestedP p :: TESTED csk k -> TESTED csj j -> Type)) a a Github # counit :: ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) :.: (TestedP q :: TESTED csj j -> TESTED csk k -> Type)) :~> ((~>) :: CAT (TESTED csk k)) Github # | |||||
| DaggerProfunctor p => DaggerProfunctor (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | |||||
| Promonad p => Promonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | |||||
| (Procomonad p, Testable k, TestObIsOb k) => Procomonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | The procomonad the objects stand for. The middle object of | ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (UnitF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (InitF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (TermF :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (DualF a :: TESTED cs k) Source Github # | |||||
| type Untest (a **! b :: TESTED cs k) Source Github # | |||||
| type Untest (a --> b :: TESTED cs k) Source Github # | |||||
| type Untest (a + b :: TESTED cs k) Source Github # | |||||
| type Untest (a *! b :: TESTED cs k) Source Github # | |||||
| type Untest (CorepF p a :: TESTED csj j) Source Github # | |||||
| type Untest (RepF p b :: TESTED csk k) Source Github # | |||||
| type Unit Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type InitialObject Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (~>) Source Github # | |||||
| type TerminalObject Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Dual (a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Ob (a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (a :: TESTED cs k) ** (b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (a :: TESTED cs k) ~~> (b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (a :: TESTED cs k) || (b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (a :: TESTED cs k) && (b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type (TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% (a :: TESTED csk k) Source Github # | |||||
| type (TestedP p :: TESTED csk k -> TESTED csj j -> Type) % (b :: TESTED csj j) Source Github # | |||||
class Tested (a :: TESTED cs k) where Source Github #
The objects of TESTED: those that stand for an object of k (Untest), with how to
rebuild that object's Ob and TestOb from the ones of its parts. This is Ob for TESTED.
Associated Types
type Untest (a :: TESTED cs k) :: k Source Github #
The object of k that a stands for. (The class variable is re-annotated so that k is
in scope in the result kind.)
Methods
untestOb :: (Ob (Untest a) => r) -> r Source Github #
The Ob of the object a stands for, which the structures of k provide.
untestTestOb :: Witnesses cs k -> (TestOb (Untest a) => r) -> r Source Github #
The TestOb of the object a stands for, which the witnesses provide.
Instances
untestOb2 :: forall {cs1 :: [Kind -> Constraint]} {k1} {cs2 :: [Kind -> Constraint]} {k2} (a :: TESTED cs2 k2) (b :: TESTED cs1 k1) r. (Tested a, Tested b) => ((Ob (Untest a), Ob (Untest b)) => r) -> r Source Github #
untestOb of two objects at once.
untestOb3 :: forall {cs1 :: [Kind -> Constraint]} {k1} {cs2 :: [Kind -> Constraint]} {k2} {cs3 :: [Kind -> Constraint]} {k3} (a :: TESTED cs3 k3) (b :: TESTED cs1 k1) (c :: TESTED cs2 k2) r. (Tested a, Tested b, Tested c) => ((Ob (Untest a), Ob (Untest b), Ob (Untest c)) => r) -> r Source Github #
untestOb of three objects at once.
untestTestOb2 :: forall {cs :: [Kind -> Constraint]} {k} (a :: TESTED cs k) (b :: TESTED cs k) r. (Tested a, Tested b) => Witnesses cs k -> ((TestOb (Untest a), TestOb (Untest b)) => r) -> r Source Github #
untestTestOb of two objects at once.
type TestedArr = TestedP (Hom k) :: TESTED cs k -> TESTED cs k -> Type Source Github #
An arrow of k between the objects the endpoints stand for, with a description of how it was
built: an element of the hom profunctor. These are the arrows of TESTED.
pattern TestedArr :: forall cs k a b. () => (Tested a, Tested b) => Doc -> (Untest a ~> Untest b) -> TestedArr a b Source Github #
TestedP at the hom profunctor.
Interpreting profunctors
data TestedP (p :: j +-> k) (a :: TESTED csk k) (b :: TESTED csj j) where Source Github #
An element of p between the objects the endpoints stand for, with a description of how it
was built, for printing a failing law.
Constructors
| TestedP :: forall {csk :: [Kind -> Constraint]} {k} {csj :: [Kind -> Constraint]} {j} (a :: TESTED csk k) (b :: TESTED csj j) (p :: j +-> k). (Tested a, Tested b) => Doc -> p (Untest a) (Untest b) -> TestedP p a b |
Instances
| (HasWitness Monoidal cs, Testable k, Monoidal k, Costrong (Tensor :: k -> (k, k) -> Type) p, TestOb (Unit :: k)) => Costrong (Tensor :: TESTED cs k -> (TESTED cs k, TESTED cs k) -> Type) (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # |
|
Defined in Proarrow.Testing.Laws.Run | |
| (HasWitness Monoidal cs, Testable k, Monoidal k, Strong (Tensor :: k -> (k, k) -> Type) p, TestOb (Unit :: k)) => Strong (Tensor :: TESTED cs k -> (TESTED cs k, TESTED cs k) -> Type) (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # |
|
Defined in Proarrow.Testing.Laws.Run | |
| Finitary p => Finitary (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |
Defined in Proarrow.Testing.Laws.Run Methods size :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => Natural Github # toIndex :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => TestedP p a b -> Natural Github # fromIndex :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => Natural -> TestedP p a b Github # elements :: forall (a :: TESTED csk k) (b :: TESTED csj j). (Ob a, Ob b) => [TestedP p a b] Github # | |
| (HasWitness Monoidal csj, HasWitness Monoidal csk, Testable j, Testable k, MonoidalProfunctor p, TestOb (Unit :: j), TestOb (Unit :: k)) => MonoidalProfunctor (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |
| Profunctor p => Profunctor (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |
Defined in Proarrow.Testing.Laws.Run Methods dimap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j) (d :: TESTED csj j). (c ~> a) -> (b ~> d) -> TestedP p a b -> TestedP p c d Github # lmap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j). (c ~> a) -> TestedP p a b -> TestedP p c b Github # rmap :: forall (b :: TESTED csj j) (d :: TESTED csj j) (a :: TESTED csk k). (b ~> d) -> TestedP p a b -> TestedP p a d Github # (\\) :: forall (a :: TESTED csk k) (b :: TESTED csj j) r. ((Ob a, Ob b) => r) -> TestedP p a b -> r Github # | |
| (HasWitness (CorepresentedBy csk p) csj, Corepresentable p) => Corepresentable (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |
Defined in Proarrow.Testing.Laws.Run Methods coindex :: forall (a :: TESTED csk k) (b :: TESTED csj j). TestedP p a b -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> b Github # cotabulate :: forall (a :: TESTED csk k) (b :: TESTED csj j). Ob a => (((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> b) -> TestedP p a b Github # corepMap :: forall (a :: TESTED csk k) (b :: TESTED csk k). (a ~> b) -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% b) Github # corepUniv :: forall (a :: TESTED csk k). Ob a => TestedP p a ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% a) Github # | |
| (HasWitness (RepresentedBy csj p) csk, Representable p) => Representable (TestedP p :: TESTED csk k -> TESTED csj j -> Type) Source Github # | |
Defined in Proarrow.Testing.Laws.Run Methods index :: forall (a :: TESTED csk k) (b :: TESTED csj j). TestedP p a b -> a ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b) Github # tabulate :: forall (b :: TESTED csj j) (a :: TESTED csk k). Ob b => (a ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b)) -> TestedP p a b Github # repMap :: forall (a :: TESTED csj j) (b :: TESTED csj j). (a ~> b) -> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) ~> ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % b) Github # repUniv :: forall (a :: TESTED csj j). Ob a => TestedP p ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) a Github # | |
| (Proadjunction p q, Testable j, Testable k, TestObIsOb j, TestObIsOb k) => Proadjunction (TestedP p :: TESTED csk k -> TESTED csj j -> Type) (TestedP q :: TESTED csj j -> TESTED csk k -> Type) Source Github # | The adjunction of the profunctors the objects stand for. The middle object of the |
Defined in Proarrow.Testing.Laws.Run Methods unit :: forall (a :: TESTED csj j). Ob a => ((TestedP q :: TESTED csj j -> TESTED csk k -> Type) :.: (TestedP p :: TESTED csk k -> TESTED csj j -> Type)) a a Github # counit :: ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) :.: (TestedP q :: TESTED csj j -> TESTED csk k -> Type)) :~> ((~>) :: CAT (TESTED csk k)) Github # | |
| DaggerProfunctor p => DaggerProfunctor (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | |
| Promonad p => Promonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | |
| (Procomonad p, Testable k, TestObIsOb k) => Procomonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | The procomonad the objects stand for. The middle object of |
Defined in Proarrow.Testing.Laws.Run | |
| type (TestedP p :: TESTED csk k -> TESTED csj j -> Type) %% (a :: TESTED csk k) Source Github # | |
| type (TestedP p :: TESTED csk k -> TESTED csj j -> Type) % (b :: TESTED csj j) Source Github # | |
data family RepF (p :: j +-> k) (b :: TESTED csj j) :: o Source Github #
The object p , for the interpretation of a % bRepresentable p.
Instances
| (HasWitness (RepresentedBy csj p) csk, Representable p, Tested b) => Tested (RepF p b :: TESTED csk k) Source Github # | |
Defined in Proarrow.Testing.Laws.Run | |
| type Untest (RepF p b :: TESTED csk k) Source Github # | |
class RepresentedBy (csj :: [Kind -> Constraint]) (p :: j +-> k) k' Source Github #
The structure of being closed under the representing functor of p, whose objects in TESTED
are formed by RepF. Its witness needs the witnesses of the domain j of p, csj.
Instances
| RepresentedBy csj (p :: j +-> k) k' Source Github # | |
Defined in Proarrow.Testing.Laws.Run | |
data family CorepF (p :: j +-> k) (a :: TESTED csk k) :: o Source Github #
The object p , for the interpretation of a %% aCorepresentable p.
Instances
| (HasWitness (CorepresentedBy csk p) csj, Corepresentable p, Tested a) => Tested (CorepF p a :: TESTED csj j) Source Github # | |
Defined in Proarrow.Testing.Laws.Run | |
| type Untest (CorepF p a :: TESTED csj j) Source Github # | |
class CorepresentedBy (csk :: [Kind -> Constraint]) (p :: j +-> k) j' Source Github #
The structure of being closed under the corepresenting functor of p, whose objects in
TESTED are formed by CorepF. Its witness needs the witnesses of the codomain k of p,
csk.
Instances
| CorepresentedBy csk (p :: j +-> k) j' Source Github # | |
Defined in Proarrow.Testing.Laws.Run | |
Describing arrows
type Doc = Int -> ShowS Source Github #
A description that can be shown at a precedence, like showsPrec.
prim :: forall {csk :: [Kind -> Constraint]} {k} {csj :: [Kind -> Constraint]} {j} (a :: TESTED csk k) (b :: TESTED csj j) p. (Tested a, Tested b) => String -> p (Untest a) (Untest b) -> TestedP p a b Source Github #
An element or arrow described by its name.