| 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,infixlDoc,infixrDocfor operations on arrows).
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
- 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 -> 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'
- 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.
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 -> 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, and the TestOptions apply to each law's property.
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 StarAutonomous cs, StarAutonomous k, Tested a) => Tested (DualF a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness Monoidal cs, Monoidal k, Tested a, Tested b) => Tested (a **! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness Closed cs, Closed k, Tested a, Tested b) => Tested (a --> b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness HasBinaryCoproducts cs, HasBinaryCoproducts k, Tested a, Tested b) => Tested (a + b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness HasBinaryProducts cs, HasBinaryProducts k, Tested a, Tested b) => Tested (a *! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness (RepresentedBy csj p) csk, Representable p, Tested b) => Tested (RepF p b :: TESTED csk k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (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 leftUnitor :: forall (a :: TESTED cs k). Ob a => ((Unit :: TESTED cs k) ** a) ~> a leftUnitorInv :: forall (a :: TESTED cs k). Ob a => a ~> ((Unit :: TESTED cs k) ** a) rightUnitor :: forall (a :: TESTED cs k). Ob a => (a ** (Unit :: TESTED cs k)) ~> a rightUnitorInv :: forall (a :: TESTED cs k). Ob a => a ~> (a ** (Unit :: TESTED cs k)) 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)) 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) | |||||
| (HasWitness Monoidal cs, Testable k, SymMonoidal k, TestOb (Unit :: k)) => SymMonoidal (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (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 curry :: forall (a :: TESTED cs k) (b :: TESTED cs k) (c :: TESTED cs k). (Ob a, Ob b) => ((a ** b) ~> c) -> a ~> (b ~~> c) apply :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => ((a ~~> b) ** a) ~> b (^^^) :: 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) | |||||
| (HasWitness Monoidal cs, HasWitness Closed cs, HasWitness StarAutonomous cs, Testable k, CompactClosed k, TestOb (Unit :: k)) => CompactClosed (TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Methods distribDual :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => Dual (a ** b) ~> (Dual a ** Dual b) dualUnit :: Dual (Unit :: TESTED cs k) ~> (Unit :: TESTED cs k) dualityUnit :: forall (a :: TESTED cs k). Ob a => (Unit :: TESTED cs k) ~> (a ** Dual a) dualityCounit :: forall (a :: TESTED cs k). Ob a => (Dual a ** a) ~> (Unit :: TESTED cs k) | |||||
| (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 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)) 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)) absorbL :: forall (a :: TESTED cs k). Ob a => (a ** (InitialObject :: TESTED cs k)) ~> (InitialObject :: TESTED cs k) absorbR :: forall (a :: TESTED cs k). Ob a => ((InitialObject :: TESTED cs k) ** a) ~> (InitialObject :: TESTED cs k) | |||||
| (HasWitness Monoidal cs, HasWitness Closed cs, HasWitness StarAutonomous cs, Testable k, StarAutonomous k, TestOb (Unit :: k)) => StarAutonomous (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 dual :: forall (a :: TESTED cs k) (b :: TESTED cs k). (a ~> b) -> Dual b ~> Dual a dualInv :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => (Dual a ~> Dual b) -> b ~> a 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) 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 doubleNeg :: forall (a :: TESTED cs k). Ob a => Dual (Dual a) ~> a doubleNegInv :: forall (a :: TESTED cs k). Ob a => a ~> Dual (Dual a) | |||||
| (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 lft :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => a ~> (a || b) rgt :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => b ~> (a || b) (|||) :: forall (x :: TESTED cs k) (a :: TESTED cs k) (y :: TESTED cs k). (x ~> a) -> (y ~> a) -> (x || y) ~> a (+++) :: 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) | |||||
| (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 Associated Types
| |||||
| (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 fst :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => (a && b) ~> a snd :: forall (a :: TESTED cs k) (b :: TESTED cs k). (Ob a, Ob b) => (a && b) ~> b (&&&) :: forall (a :: TESTED cs k) (x :: TESTED cs k) (y :: TESTED cs k). (a ~> x) -> (a ~> y) -> a ~> (x && y) (***) :: 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) | |||||
| (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 # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (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. | ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (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. | ||||
Defined in Proarrow.Testing.Laws.Run | |||||
| (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 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 lmap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j). (c ~> a) -> TestedP p a b -> TestedP p c b rmap :: forall (b :: TESTED csj j) (d :: TESTED csj j) (a :: TESTED csk k). (b ~> d) -> TestedP p a b -> TestedP p a d (\\) :: forall (a :: TESTED csk k) (b :: TESTED csj j) r. ((Ob a, Ob b) => r) -> TestedP p a b -> r | |||||
| (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) 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 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) repUniv :: forall (a :: TESTED csj j). Ob a => TestedP p ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) a | |||||
| Promonad p => Promonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) Source Github # | |||||
| 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 # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (a **! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (a --> b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (a + b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (a *! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Untest (RepF p b :: TESTED csk k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type Unit Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run type Unit = UnitF :: TESTED cs k | |||||
| type InitialObject Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run type InitialObject = InitF :: TESTED cs k | |||||
| type (~>) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
| type TerminalObject Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run type TerminalObject = TermF :: TESTED cs k | |||||
| type Dual (a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run type Dual (a :: TESTED cs k) = DualF a | |||||
| 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) % (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
| (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 StarAutonomous cs, StarAutonomous k, Tested a) => Tested (DualF a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness Monoidal cs, Monoidal k, Tested a, Tested b) => Tested (a **! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness Closed cs, Closed k, Tested a, Tested b) => Tested (a --> b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness HasBinaryCoproducts cs, HasBinaryCoproducts k, Tested a, Tested b) => Tested (a + b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness HasBinaryProducts cs, HasBinaryProducts k, Tested a, Tested b) => Tested (a *! b :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (Testable k, TestOb a) => Tested ('TLeaf a :: TESTED cs k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
| (HasWitness (RepresentedBy csj p) csk, Representable p, Tested b) => Tested (RepF p b :: TESTED csk k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run Associated Types
| |||||
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 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 lmap :: forall (c :: TESTED csk k) (a :: TESTED csk k) (b :: TESTED csj j). (c ~> a) -> TestedP p a b -> TestedP p c b rmap :: forall (b :: TESTED csj j) (d :: TESTED csj j) (a :: TESTED csk k). (b ~> d) -> TestedP p a b -> TestedP p a d (\\) :: forall (a :: TESTED csk k) (b :: TESTED csj j) r. ((Ob a, Ob b) => r) -> TestedP p a b -> r | |
| (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) 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 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) repUniv :: forall (a :: TESTED csj j). Ob a => TestedP p ((TestedP p :: TESTED csk k -> TESTED csj j -> Type) % a) a | |
| Promonad p => Promonad (TestedP p :: TESTED cs k -> TESTED cs k -> Type) 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 Associated Types
| |||||
| type Untest (RepF p b :: TESTED csk k) Source Github # | |||||
Defined in Proarrow.Testing.Laws.Run | |||||
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 | |
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.