| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Evaluation.Builtins.Bitwise.CIP0122
Description
Tests for CIP-0122 (the first batch of bitwise builtins)
Synopsis
- abelianSemigroupLaws :: DefaultFun -> TestTree #
Checks that the given
DefaultFun, under the given semantics, forms an abelian semigroup: that is, the operation both commutes and associates.
abelianMonoidLaws :: DefaultFun -> TestTree #
As abelianSemigroupLaws, but also checks that the provided ByteString
is both a left and right identity.
idempotenceLaw :: DefaultFun -> TestTree #
Checks that the provided DefaultFun, under the given semantics, is
idempotent; namely, that f x x = x for any x.
absorbtionLaw :: DefaultFun -> TestTree #
Checks that the provided ByteString is an absorbing element for the
given DefaultFun, under the given semantics. Specifically, given f
as the operation and 0 as the absorbing element, for any x,
f x 0 = f 0 x = 0.
leftDistributiveLaw :: DefaultFun -> TestTree #
Checks that the first DefaultFun distributes over the second from the
left, given the specified semantics (as a Bool). More precisely, for
DefaultFuns f and g, checks that f x (g y z) = g (f x y) (f x z).
distributiveLaws :: DefaultFun -> TestTree #
If you retrieve a bit value at an index, then write that same value to the same index, nothing should happen.
If you write a bit value to an index, then retrieve the bit value at the same index, you should get back what you wrote.
Checks that:
- Replicating any byte 0 times produces the empty
ByteString; and - Replicating a byte
ntimes, then replicating a bytemtimes and concatenating the results, is the same as replicating that byten + mtimes.
Any call to replicateByteString must produce the same byte at
every valid index, namely the byte specified.