plutus-core-1.70.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Flat.Memory

Description

Memory access primitives.

Includes code from the store-core package.

Synopsis

Documentation

data ByteArray Source #

Lifted wrapper for ByteArray#.

Since ByteArray# is an unlifted type and not a member of kind Type, things like [ByteArray#] or IO ByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting Type. Clients are expected to use ByteArray in higher-level APIs, but wrap and unwrap ByteArray internally as they please and use functions from GHC.Exts.

Since: base-4.17.0.0

Instances

Instances details
Data ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → ByteArray → c ByteArray Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c ByteArray Source #

toConstr ∷ ByteArray → Constr Source #

dataTypeOf ∷ ByteArray → DataType Source #

dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c ByteArray) Source #

dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c ByteArray) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → ByteArray → ByteArray Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → ByteArray → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → ByteArray → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → ByteArray → [u] Source #

gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → ByteArray → u Source #

gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → ByteArray → m ByteArray Source #

gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ByteArray → m ByteArray Source #

gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ByteArray → m ByteArray Source #

Monoid ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Semigroup ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

IsList ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Associated Types

type Item ByteArray Source #

Show ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

NFData ByteArray

Since: deepseq-1.4.7.0

Instance details

Defined in Control.DeepSeq

Methods

rnf ∷ ByteArray → () Source #

Eq ByteArray

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Ord ByteArray

Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.

Since: base-4.17.0.0

Instance details

Defined in Data.Array.Byte

Hashable ByteArray

This instance was available since 1.4.1.0 only for GHC-9.4+

Since: hashable-1.4.2.0

Instance details

Defined in Data.Hashable.Class

Lift ByteArray

Since: template-haskell-2.19.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift ∷ Quote m ⇒ ByteArray → m Exp Source #

liftTyped ∷ ∀ (m ∷ Type → Type). Quote m ⇒ ByteArray → Code m ByteArray Source #

type Item ByteArray 
Instance details

Defined in Data.Array.Byte

pokeByteArray ∷ ByteArray# → Int → Int → Ptr Word8 → IO (Ptr Word8) Source #

Copy ByteArray to given pointer, returns new pointer

pokeByteString ∷ ByteString → Ptr Word8 → IO (Ptr Word8) Source #

Copy bytestring to given pointer, returns new pointer

unsafeCreateUptoN' ∷ Int → (Ptr Word8 → IO (Int, a)) → (ByteString, a) Source #

minusPtr ∷ Ptr a → Ptr b → Int Source #

Computes the offset required to get from the second to the first argument. We have

p2 == p1 `plusPtr` (p2 `minusPtr` p1)

peekByteString Source #

Arguments

∷ Ptr Word8

sourcePtr

→ Int

sourceLen

→ ByteString 

Create a new bytestring, copying sourceLen bytes from sourcePtr

Since: 0.6