| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Plutarch.Internal.Semigroup
Contents
Type classes
class PSemigroup (a :: S -> Type) where Source #
Laws
The only mandatory law is that #<> must be associative:
x #<> (y #<> z) = (x #<> y) #<> z
If you define pstimes, ensure the following also hold:
pstimes pone x=x(pstimes p1 x) #<> (pstimes p2 x)=pstimes (p1 #+ p2) xpstimes p1 (pstimes p2 x)=pstimes (p1 #* p2) x
The default implementation automatically ensures these laws hold.
Since: 1.10.0
Minimal complete definition
Nothing
Methods
(#<>) :: forall (s :: S). Term s a -> Term s a -> Term s a infixr 6 Source #
default (#<>) :: forall (s :: S). PSemigroup (PInner a) => Term s a -> Term s a -> Term s a Source #
pstimes :: forall (s :: S). Term s PPositive -> Term s a -> Term s a Source #
Instances
class PSemigroup a => PMonoid (a :: S -> Type) where Source #
Laws
pmempty #<> x=x #<> pmempty=xpstimes n pmempty=pmempty
If you define pmtimes, ensure the following as well:
pmtimes (ppositiveToNatural # p) x=pstimes p xpmtimes pzero x=pmempty
The default implementation of pmtimes ensures these laws hold.
Since: 1.10.0
Minimal complete definition
Nothing
Methods
pmempty :: forall (s :: S). Term s a Source #
pmtimes :: forall (s :: S). Term s PNatural -> Term s a -> Term s a Source #
Instances
| PMonoid PBitString Source # | Since: 1.10.0 |
Defined in Plutarch.BitString | |
| PMonoid PBuiltinBLS12_381_G1_Element Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| PMonoid PBuiltinBLS12_381_G2_Element Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| PMonoid PByteString Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| PMonoid PString Source # | Since: 1.10.0 |
| PMonoid PUnit Source # | Since: 1.10.0 |
| PMonoid (PAnd PBool) Source # | Since: 1.10.0 |
| PMonoid (PAnd PByteString) Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| PMonoid (POr PBool) Source # | Since: 1.10.0 |
| PMonoid (POr PByteString) Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| PMonoid (PXor PBool) Source # | Since: 1.10.0 |
| PMonoid (PXor PByteString) Source # | Since: 1.10.0 |
Defined in Plutarch.Internal.Semigroup | |
| (PMonoid a, PMonoid b) => PMonoid (PPair a b) Source # | Since: 1.10.0 |
Helper newtypes
newtype PAnd (a :: S -> Type) (s :: S) Source #
Wrapper for types which have logical AND semantics somehow.
Since: 1.10.0
Instances
newtype POr (a :: S -> Type) (s :: S) Source #
Wrapper for types which have logical OR semantics somehow.
Since: 1.10.0
Instances
newtype PXor (a :: S -> Type) (s :: S) Source #
Wrapper for types which have logical XOR semantics somehow.
Since: 1.10.0