plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Builtin.ByteString

Synopsis

Documentation

newtype PByteString s Source #

Plutus BuiltinByteString

Constructors

PByteString (Term s POpaque) 

Instances

Instances details
PEq PByteString Source # 
Instance details

Defined in Plutarch.Internal.Eq

Methods

(#==) :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PBool Source #

PIsData PByteString Source # 
Instance details

Defined in Plutarch.Internal.IsData

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PByteString) -> Term s PByteString Source #

pdataImpl :: forall (s :: S). Term s PByteString -> Term s PData Source #

PLiftable PByteString Source # 
Instance details

Defined in Plutarch.Internal.Lift

POrd PByteString Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PBool Source #

pmax :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PByteString Source #

pmin :: forall (s :: S). Term s PByteString -> Term s PByteString -> Term s PByteString Source #

DerivePlutusType PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Associated Types

type DPTStrat PByteString Source #

PlutusType PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Methods

pcon' :: forall (s :: S). PByteString s -> Term s (PInner PByteString) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PByteString) -> (PByteString s -> Term s b) -> Term s b Source #

PShow PByteString Source # 
Instance details

Defined in Plutarch.Internal.Show

Methods

pshow' :: forall (s :: S). Bool -> Term s PByteString -> Term s PString Source #

PTryFrom PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Internal.TryFrom

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData PByteString), Reduce (PTryFromExcess PData (PAsData PByteString) s)) -> Term s r) -> Term s r Source #

Generic (PByteString s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

Associated Types

type Rep (PByteString s) :: Type -> Type Source #

PLiftable (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Internal.Lift

Monoid (Term s PByteString) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

Semigroup (Term s PByteString) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

type AsHaskell PByteString Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Lift

type PlutusRepr PByteString Source # 
Instance details

Defined in Plutarch.Internal.Lift

type DPTStrat PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PContravariant' PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' PByteString Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PTryFromExcess PData (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Internal.TryFrom

type Rep (PByteString s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

type Rep (PByteString s) = D1 ('MetaData "PByteString" "Plutarch.Builtin.ByteString" "plutarch-1.9.0-FtN0mhIoM9oEvz7Q98pjWP" 'True) (C1 ('MetaCons "PByteString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s POpaque))))
type AsHaskell (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Internal.Lift

type PlutusRepr (PAsData PByteString) Source # 
Instance details

Defined in Plutarch.Internal.Lift

newtype PByte (s :: S) Source #

A Plutarch-level representation of bytes.

Note =

This type is intentionally quite restrictive, as it's not really meant to be computed with. Instead, it ensures certain operations' type safety while also allowing more sensible signatures. If you want to do anything with PBytes, we recommend converting them to PIntegers first.

@since WIP

Constructors

PByte (Term s POpaque) 

Instances

Instances details
PEq PByte Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Eq

Methods

(#==) :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PBool Source #

PLiftable PByte Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Lift

Associated Types

type AsHaskell PByte Source #

type PlutusRepr PByte Source #

POrd PByte Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PBool Source #

pmax :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PByte Source #

pmin :: forall (s :: S). Term s PByte -> Term s PByte -> Term s PByte Source #

DerivePlutusType PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Associated Types

type DPTStrat PByte Source #

PlutusType PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Methods

pcon' :: forall (s :: S). PByte s -> Term s (PInner PByte) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PByte) -> (PByte s -> Term s b) -> Term s b Source #

Generic (PByte s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

Associated Types

type Rep (PByte s) :: Type -> Type Source #

Methods

from :: PByte s -> Rep (PByte s) x Source #

to :: Rep (PByte s) x -> PByte s Source #

type AsHaskell PByte Source # 
Instance details

Defined in Plutarch.Internal.Lift

type PlutusRepr PByte Source # 
Instance details

Defined in Plutarch.Internal.Lift

type DPTStrat PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PContravariant' PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' PByte Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type Rep (PByte s) Source #

@since WIP

Instance details

Defined in Plutarch.Builtin.ByteString

type Rep (PByte s) = D1 ('MetaData "PByte" "Plutarch.Builtin.ByteString" "plutarch-1.9.0-FtN0mhIoM9oEvz7Q98pjWP" 'True) (C1 ('MetaCons "PByte" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s POpaque))))

newtype PLogicOpSemantics (s :: S) Source #

Type designating whether logical operations should use padding or truncation semantics. See CIP-122 for more details on this.

@since WIP

Constructors

PLogicOpSemantics (Term s PBool) 

Instances

Instances details
PEq PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.Eq

Methods

(#==) :: forall (s :: S). Term s PLogicOpSemantics -> Term s PLogicOpSemantics -> Term s PBool Source #

POrd PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.Ord

DerivePlutusType PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Associated Types

type DPTStrat PLogicOpSemantics Source #

PlutusType PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Methods

pcon' :: forall (s :: S). PLogicOpSemantics s -> Term s (PInner PLogicOpSemantics) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PLogicOpSemantics) -> (PLogicOpSemantics s -> Term s b) -> Term s b Source #

Generic (PLogicOpSemantics s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

Associated Types

type Rep (PLogicOpSemantics s) :: Type -> Type Source #

type DPTStrat PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PContravariant' PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' PLogicOpSemantics Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type Rep (PLogicOpSemantics s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

type Rep (PLogicOpSemantics s) = D1 ('MetaData "PLogicOpSemantics" "Plutarch.Builtin.ByteString" "plutarch-1.9.0-FtN0mhIoM9oEvz7Q98pjWP" 'True) (C1 ('MetaCons "PLogicOpSemantics" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PBool))))

newtype PEndianness (s :: S) Source #

Type designating whether a conversion should be most-significant-first or most-significant-last. See CIP-121 for more details on this.

@since WIP

Constructors

PEndianness (Term s PBool) 

Instances

Instances details
PEq PEndianness Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Eq

Methods

(#==) :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PBool Source #

POrd PEndianness Source #

@since WIP

Instance details

Defined in Plutarch.Internal.Ord

Methods

(#<=) :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PBool Source #

pmax :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PEndianness Source #

pmin :: forall (s :: S). Term s PEndianness -> Term s PEndianness -> Term s PEndianness Source #

DerivePlutusType PEndianness Source #

@since WIP

Instance details

Defined in Plutarch.Internal.PlutusType

Associated Types

type DPTStrat PEndianness Source #

PlutusType PEndianness Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

Methods

pcon' :: forall (s :: S). PEndianness s -> Term s (PInner PEndianness) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PEndianness) -> (PEndianness s -> Term s b) -> Term s b Source #

Generic (PEndianness s) Source # 
Instance details

Defined in Plutarch.Builtin.ByteString

Associated Types

type Rep (PEndianness s) :: Type -> Type Source #

type DPTStrat PEndianness Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PContravariant' PEndianness Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PCovariant' PEndianness Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type PInner PEndianness Source #

@since WIP

Instance details

Defined in Plutarch.Internal.PlutusType

type PVariant' PEndianness Source # 
Instance details

Defined in Plutarch.Internal.PlutusType

type Rep (PEndianness s) Source #

@since WIP

Instance details

Defined in Plutarch.Builtin.ByteString

type Rep (PEndianness s) = D1 ('MetaData "PEndianness" "Plutarch.Builtin.ByteString" "plutarch-1.9.0-FtN0mhIoM9oEvz7Q98pjWP" 'True) (C1 ('MetaCons "PEndianness" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PBool))))

ppadding :: forall (s :: S). Term s PLogicOpSemantics Source #

Indicates that padding semantics should be used.

@since WIP

ptruncation :: forall (s :: S). Term s PLogicOpSemantics Source #

Indicates that truncation semantics should be used.

@since WIP

pmostSignificantFirst :: forall (s :: S). Term s PEndianness Source #

Indicates the conversion should be most-significant-first.

@since WIP

pmostSignificantLast :: forall (s :: S). Term s PEndianness Source #

Indicates the conversion should be most-significant-last.

@since WIP

pandBS :: forall (s :: S). Term s (PLogicOpSemantics :--> (PByteString :--> (PByteString :--> PByteString))) Source #

Perform the logical AND of two PByteStrings, as per CIP-122. The PLogicOpSemantics argument specifies what should be done if the lengths of the two PByteString arguments do not match.

@since WIP

porBS :: forall (s :: S). Term s (PLogicOpSemantics :--> (PByteString :--> (PByteString :--> PByteString))) Source #

Perform the logical OR of two PByteStrings, as per CIP-122. The PLogicOpSemantics argument specifies what should be done if the lengths of the two PByteString arguments do not match.

@since WIP

pxorBS :: forall (s :: S). Term s (PLogicOpSemantics :--> (PByteString :--> (PByteString :--> PByteString))) Source #

Perform the logical XOR of two PByteStrings, as per CIP-122. The PLogicOpSemantics argument specifies what should be done if the lengths of the two PByteString arguments do not match.

@since WIP

pcomplementBS :: forall (s :: S). Term s (PByteString :--> PByteString) Source #

Perform the logical complement of a PByteString, as per CIP-122.

@since WIP

preplicateBS :: forall (s :: S). Term s (PInteger :--> (PByte :--> PByteString)) Source #

Given a desired length and a PByte, construct a PByteString of the specified length (0 if negative) consisting entirely of that PByte.

@since WIP

pconsBS :: Term s (PByte :--> (PByteString :--> PByteString)) Source #

Prepend a PByte to a 'PByteString.

@since WIP

pbyteToInteger :: Term s (PByte :--> PInteger) Source #

Convert a PByte into its corresponding PInteger.

@since WIP

pintegerToByte :: Term s (PInteger :--> PByte) Source #

Try to convert a PInteger into its corresponding PByte. This operation unchecked: use with care.

@since WIP

psliceBS :: Term s (PInteger :--> (PInteger :--> (PByteString :--> PByteString))) Source #

Slice a PByteString with given start index and slice length.

>>> (pslice # 2 # 3 phexByteStr "4102afde5b2a") #== phexByteStr "afde5b"

pindexBS :: Term s (PByteString :--> (PInteger :--> PByte)) Source #

Given a valid index into a PByteString, returns the PByte at that index. Will crash if given an out-of-bounds index.

@since WIP

phexByteStr :: HasCallStack => String -> Term s PByteString Source #

Interpret a hex string as a PByteString.

pbyteStringToInteger :: forall (s :: S). Term s (PEndianness :--> (PByteString :--> PInteger)) Source #

Convert a PByteString into a PInteger, as per CIP-121.

@since WIP

pintegerToByteString :: forall (s :: S). Term s (PEndianness :--> (PInteger :--> (PInteger :--> PByteString))) Source #

Converts a PInteger into a PByteString, given a desired endianness and target length. For more details, see CIP-121.

Note

This conversion is unsafe. It will fail if any of the following occur:

  1. The size is negative.
  2. The size is too large (currently if over 8196 bytes).
  3. The size won't fit the integer to convert.