plutarch-testlib
Safe HaskellNone
LanguageGHC2021

Plutarch.Test.Methods

Synopsis
  • pmaxDefaultBetter :: forall (a :: S -> Type). (POrd a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s a) -> TestTree
  • pminDefaultBetter :: forall (a :: S -> Type). (POrd a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s a) -> TestTree
  • psuccessorNBetter :: forall (a :: S -> Type). (PCountable a, Typeable a) => (forall (s :: S). Term s PPositive) -> (forall (s :: S). Term s a) -> TestTree
  • ppredecessorNBetter :: forall (a :: S -> Type). (PEnumerable a, Typeable a) => (forall (s :: S). Term s PPositive) -> (forall (s :: S). Term s a) -> TestTree
  • pscalePositiveBetter :: forall (a :: S -> Type). (PAdditiveSemigroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PPositive) -> TestTree
  • pscaleNaturalBetter :: forall (a :: S -> Type). (PAdditiveMonoid a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PNatural) -> TestTree
  • pscaleIntegerBetter :: forall (a :: S -> Type). (PAdditiveGroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PInteger) -> TestTree
  • ppowPositiveBetter :: forall (a :: S -> Type). (PMultiplicativeSemigroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PPositive) -> TestTree
  • ppowNaturalBetter :: forall (a :: S -> Type). (PMultiplicativeMonoid a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PNatural) -> TestTree

POrd

pmaxDefaultBetter :: forall (a :: S -> Type). (POrd a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s a) -> TestTree Source #

Given two arguments to test with, compares the default implementation of pmax to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

pminDefaultBetter :: forall (a :: S -> Type). (POrd a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s a) -> TestTree Source #

Given two arguments to test with, compares the default implementation of pmin to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

PCountable

psuccessorNBetter :: forall (a :: S -> Type). (PCountable a, Typeable a) => (forall (s :: S). Term s PPositive) -> (forall (s :: S). Term s a) -> TestTree Source #

Given two arguments to test with, compares the default implementation of psuccessorN to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

PEnumerable

ppredecessorNBetter :: forall (a :: S -> Type). (PEnumerable a, Typeable a) => (forall (s :: S). Term s PPositive) -> (forall (s :: S). Term s a) -> TestTree Source #

Given two arguments to test with, compares the default implementation of ppredecessorN to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

Additive

pscalePositiveBetter :: forall (a :: S -> Type). (PAdditiveSemigroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PPositive) -> TestTree Source #

Given two arguments to test with, compares the default implementation of pscalePositive to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

pscaleNaturalBetter :: forall (a :: S -> Type). (PAdditiveMonoid a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PNatural) -> TestTree Source #

Given two arguments to test with, compares the default implementation of pscaleNatural to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

pscaleIntegerBetter :: forall (a :: S -> Type). (PAdditiveGroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PInteger) -> TestTree Source #

Given two arguments to test with, compares the default implementation of pscaleInteger to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

Multiplicative

ppowPositiveBetter :: forall (a :: S -> Type). (PMultiplicativeSemigroup a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PPositive) -> TestTree Source #

Given two arguments to test with, compares the default implementation of ppowPositive to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3

ppowNaturalBetter :: forall (a :: S -> Type). (PMultiplicativeMonoid a, Typeable a) => (forall (s :: S). Term s a) -> (forall (s :: S). Term s PNatural) -> TestTree Source #

Given two arguments to test with, compares the default implementation of ppowNatural to the one defined for the given type. If the defined implementation is worse than the default in any capacity, the test fails, indicating both what metric (out of exunits, memory use or script size) was worse, and by how much; otherwise, the test passes, indicating how much better (if at all) the defined implementation is compared to the default.

Since: 1.0.3