| Safe Haskell | None |
|---|---|
| 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
| PEq a => PEq (POr a) Source # | Since: 1.10.0 | ||||||||
| (PLiftable a, Includes DefaultUni (PlutusRepr a), KnownBuiltinType (Term DeBruijn DefaultUni DefaultFun ()) (PlutusRepr a)) => PLiftable (POr a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
Methods haskToRepr :: AsHaskell (POr a) -> PlutusRepr (POr a) Source # reprToHask :: PlutusRepr (POr a) -> Either LiftError (AsHaskell (POr a)) Source # reprToPlut :: forall (s :: S). PlutusRepr (POr a) -> PLifted s (POr a) Source # plutToRepr :: (forall (s :: S). PLifted s (POr a)) -> Either LiftError (PlutusRepr (POr a)) Source # | |||||||||
| POrd a => POrd (POr a) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup Methods (#<=) :: forall (s :: S). Term s (POr a) -> Term s (POr a) -> Term s PBool Source # (#<) :: forall (s :: S). Term s (POr a) -> Term s (POr a) -> Term s PBool Source # pmax :: forall (s :: S). Term s (POr a) -> Term s (POr a) -> Term s (POr a) Source # pmin :: forall (s :: S). Term s (POr a) -> Term s (POr a) -> Term s (POr a) Source # | |||||||||
| PlutusType (POr a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
| |||||||||
| PMonoid (POr PBool) Source # | Since: 1.10.0 | ||||||||
| PMonoid (POr PByteString) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| PSemigroup (POr PBool) Source # | Since: 1.10.0 | ||||||||
| PSemigroup (POr PByteString) Source # | This uses padding semantics as specified in CIP-122, as this allows a
Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup Methods (#<>) :: forall (s :: S). Term s (POr PByteString) -> Term s (POr PByteString) -> Term s (POr PByteString) Source # pstimes :: forall (s :: S). Term s PPositive -> Term s (POr PByteString) -> Term s (POr PByteString) Source # | |||||||||
| Generic (POr a s) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
| |||||||||
| Generic (POr a s) Source # | |||||||||
| type AsHaskell (POr a) Source # | Since: 1.13.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type PlutusRepr (POr a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type PInner (POr a) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type Rep (POr a s) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type Code (POr a s) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
newtype PXor (a :: S -> Type) (s :: S) Source #
Wrapper for types which have logical XOR semantics somehow.
Since: 1.10.0
Instances
| PEq a => PEq (PXor a) Source # | Since: 1.10.0 | ||||||||
| (PLiftable a, Includes DefaultUni (PlutusRepr a), KnownBuiltinType (Term DeBruijn DefaultUni DefaultFun ()) (PlutusRepr a)) => PLiftable (PXor a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
Methods haskToRepr :: AsHaskell (PXor a) -> PlutusRepr (PXor a) Source # reprToHask :: PlutusRepr (PXor a) -> Either LiftError (AsHaskell (PXor a)) Source # reprToPlut :: forall (s :: S). PlutusRepr (PXor a) -> PLifted s (PXor a) Source # plutToRepr :: (forall (s :: S). PLifted s (PXor a)) -> Either LiftError (PlutusRepr (PXor a)) Source # | |||||||||
| POrd a => POrd (PXor a) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup Methods (#<=) :: forall (s :: S). Term s (PXor a) -> Term s (PXor a) -> Term s PBool Source # (#<) :: forall (s :: S). Term s (PXor a) -> Term s (PXor a) -> Term s PBool Source # pmax :: forall (s :: S). Term s (PXor a) -> Term s (PXor a) -> Term s (PXor a) Source # pmin :: forall (s :: S). Term s (PXor a) -> Term s (PXor a) -> Term s (PXor a) Source # | |||||||||
| PlutusType (PXor a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
| |||||||||
| PMonoid (PXor PBool) Source # | Since: 1.10.0 | ||||||||
| PMonoid (PXor PByteString) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| PSemigroup (PXor PBool) Source # | Since: 1.10.0 | ||||||||
| PSemigroup (PXor PByteString) Source # | This uses padding semantics as specified in CIP-122, as this allows a
Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup Methods (#<>) :: forall (s :: S). Term s (PXor PByteString) -> Term s (PXor PByteString) -> Term s (PXor PByteString) Source # pstimes :: forall (s :: S). Term s PPositive -> Term s (PXor PByteString) -> Term s (PXor PByteString) Source # | |||||||||
| Generic (PXor a s) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup Associated Types
| |||||||||
| Generic (PXor a s) Source # | |||||||||
| type AsHaskell (PXor a) Source # | Since: 1.13.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type PlutusRepr (PXor a) Source # | |||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type PInner (PXor a) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type Rep (PXor a s) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||
| type Code (PXor a s) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Internal.Semigroup | |||||||||