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

PlutusCore.Flat.Types

Description

Common Types

Synopsis

Documentation

type NumBits = Int Source #

Number of bits

module Data.Word

module Data.Int

data Natural Source #

Natural number

Invariant: numbers <= 0xffffffffffffffff use the NS constructor

Instances

Instances details
Bits Natural

Since: base-4.8.0

Instance details

Defined in GHC.Bits

Enum Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Enum

Ix Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Ix

Num Natural

Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

Since: base-4.8.0.0

Instance details

Defined in GHC.Num

Read Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Read

Integral Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Real Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Show Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Show

NFData Natural

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf ∷ Natural → () Source #

Eq Natural 
Instance details

Defined in GHC.Num.Natural

Methods

(==) ∷ Natural → Natural → Bool Source #

(/=) ∷ Natural → Natural → Bool Source #

Ord Natural 
Instance details

Defined in GHC.Num.Natural

Hashable Natural 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt ∷ Int → Natural → Int Source #

hash ∷ Natural → Int Source #

Flat Natural Source #

Naturals are encoded just as the fixed size Words.

>>> test (0::Natural)
(True,8,"00000000")
>>> test (2^120::Natural)
(True,144,"10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 00000010")
Instance details

Defined in PlutusCore.Flat.Instances.Base

UniformRange Natural 
Instance details

Defined in System.Random.Internal

Methods

uniformRM ∷ StatefulGen g m ⇒ (Natural, Natural) → g → m Natural Source #

isInRange ∷ (Natural, Natural) → Natural → Bool Source #

KnownNat n ⇒ HasResolution (n ∷ Nat)

For example, Fixed 1000 will give you a Fixed with a resolution of 1000.

Instance details

Defined in Data.Fixed

Methods

resolution ∷ p n → Integer Source #

TestCoercion SNat

Since: base-4.18.0.0

Instance details

Defined in GHC.TypeNats

Methods

testCoercion ∷ ∀ (a ∷ k) (b ∷ k). SNat a → SNat b → Maybe (Coercion a b) Source #

TestEquality SNat

Since: base-4.18.0.0

Instance details

Defined in GHC.TypeNats

Methods

testEquality ∷ ∀ (a ∷ k) (b ∷ k). SNat a → SNat b → Maybe (a :~: b) Source #

ZigZag Integer Natural Source # 
Instance details

Defined in PlutusCore.Flat.Data.ZigZag

Lift Natural 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift ∷ Quote m ⇒ Natural → m Exp Source #

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

type Compare (a ∷ Natural) (b ∷ Natural) 
Instance details

Defined in Data.Type.Ord

type Compare (a ∷ Natural) (b ∷ Natural) = CmpNat a b

data ShortByteString Source #

A compact representation of a Word8 vector.

It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations.

Instances

Instances details
Data ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Methods

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

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

toConstr ∷ ShortByteString → Constr Source #

dataTypeOf ∷ ShortByteString → DataType Source #

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

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

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

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

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

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

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

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

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

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

IsString ShortByteString

Beware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�

Instance details

Defined in Data.ByteString.Short.Internal

Monoid ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Semigroup ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

IsList ShortByteString

Since: bytestring-0.10.12.0

Instance details

Defined in Data.ByteString.Short.Internal

Associated Types

type Item ShortByteString Source #

Read ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Show ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

NFData ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Methods

rnf ∷ ShortByteString → () Source #

Eq ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Ord ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

Hashable ShortByteString 
Instance details

Defined in Data.Hashable.Class

Flat ShortByteString Source #
>>> tst ((False,True,False,SBS.pack [11,22,33]))
(True,51,[65,3,11,22,33,0]) 
Instance details

Defined in PlutusCore.Flat.Instances.ByteString

Lift ShortByteString

Since: bytestring-0.11.2.0

Instance details

Defined in Data.ByteString.Short.Internal

Methods

lift ∷ Quote m ⇒ ShortByteString → m Exp Source #

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

type Item ShortByteString 
Instance details

Defined in Data.ByteString.Short.Internal

data Text Source #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt ∷ Int → Text → Int Source #

hash ∷ Text → Int Source #

MonoZip Text 
Instance details

Defined in Data.Containers

GrowingAppend Text 
Instance details

Defined in Data.MonoTraversable

MonoFoldable Text 
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap ∷ Monoid m ⇒ (Element Text → m) → Text → m Source #

ofoldr ∷ (Element Text → b → b) → b → Text → b Source #

ofoldl' ∷ (a → Element Text → a) → a → Text → a Source #

otoList ∷ Text → [Element Text] Source #

oall ∷ (Element Text → Bool) → Text → Bool Source #

oany ∷ (Element Text → Bool) → Text → Bool Source #

onull ∷ Text → Bool Source #

olength ∷ Text → Int Source #

olength64 ∷ Text → Int64 Source #

ocompareLength ∷ Integral i ⇒ Text → i → Ordering Source #

otraverse_ ∷ Applicative f ⇒ (Element Text → f b) → Text → f () Source #

ofor_ ∷ Applicative f ⇒ Text → (Element Text → f b) → f () Source #

omapM_ ∷ Applicative m ⇒ (Element Text → m ()) → Text → m () Source #

oforM_ ∷ Applicative m ⇒ Text → (Element Text → m ()) → m () Source #

ofoldlM ∷ Monad m ⇒ (a → Element Text → m a) → a → Text → m a Source #

ofoldMap1Ex ∷ Semigroup m ⇒ (Element Text → m) → Text → m Source #

ofoldr1Ex ∷ (Element Text → Element Text → Element Text) → Text → Element Text Source #

ofoldl1Ex' ∷ (Element Text → Element Text → Element Text) → Text → Element Text Source #

headEx ∷ Text → Element Text Source #

lastEx ∷ Text → Element Text Source #

unsafeHead ∷ Text → Element Text Source #

unsafeLast ∷ Text → Element Text Source #

maximumByEx ∷ (Element Text → Element Text → Ordering) → Text → Element Text Source #

minimumByEx ∷ (Element Text → Element Text → Ordering) → Text → Element Text Source #

oelem ∷ Element Text → Text → Bool Source #

onotElem ∷ Element Text → Text → Bool Source #

MonoFunctor Text 
Instance details

Defined in Data.MonoTraversable

Methods

omap ∷ (Element Text → Element Text) → Text → Text Source #

MonoPointed Text 
Instance details

Defined in Data.MonoTraversable

Methods

opoint ∷ Element Text → Text Source #

MonoTraversable Text 
Instance details

Defined in Data.MonoTraversable

Methods

otraverse ∷ Applicative f ⇒ (Element Text → f (Element Text)) → Text → f Text Source #

omapM ∷ Applicative m ⇒ (Element Text → m (Element Text)) → Text → m Text Source #

IsSequence Text 
Instance details

Defined in Data.Sequences

Methods

fromList ∷ [Element Text] → Text Source #

lengthIndex ∷ Text → Index Text Source #

break ∷ (Element Text → Bool) → Text → (Text, Text) Source #

span ∷ (Element Text → Bool) → Text → (Text, Text) Source #

dropWhile ∷ (Element Text → Bool) → Text → Text Source #

takeWhile ∷ (Element Text → Bool) → Text → Text Source #

splitAt ∷ Index Text → Text → (Text, Text) Source #

unsafeSplitAt ∷ Index Text → Text → (Text, Text) Source #

take ∷ Index Text → Text → Text Source #

unsafeTake ∷ Index Text → Text → Text Source #

drop ∷ Index Text → Text → Text Source #

unsafeDrop ∷ Index Text → Text → Text Source #

dropEnd ∷ Index Text → Text → Text Source #

partition ∷ (Element Text → Bool) → Text → (Text, Text) Source #

uncons ∷ Text → Maybe (Element Text, Text) Source #

unsnoc ∷ Text → Maybe (Text, Element Text) Source #

filter ∷ (Element Text → Bool) → Text → Text Source #

filterM ∷ Monad m ⇒ (Element Text → m Bool) → Text → m Text Source #

replicate ∷ Index Text → Element Text → Text Source #

replicateM ∷ Monad m ⇒ Index Text → m (Element Text) → m Text Source #

groupBy ∷ (Element Text → Element Text → Bool) → Text → [Text] Source #

groupAllOn ∷ Eq b ⇒ (Element Text → b) → Text → [Text] Source #

subsequences ∷ Text → [Text] Source #

permutations ∷ Text → [Text] Source #

tailEx ∷ Text → Text Source #

tailMay ∷ Text → Maybe Text Source #

initEx ∷ Text → Text Source #

initMay ∷ Text → Maybe Text Source #

unsafeTail ∷ Text → Text Source #

unsafeInit ∷ Text → Text Source #

index ∷ Text → Index Text → Maybe (Element Text) Source #

indexEx ∷ Text → Index Text → Element Text Source #

unsafeIndex ∷ Text → Index Text → Element Text Source #

splitWhen ∷ (Element Text → Bool) → Text → [Text] Source #

tails ∷ Text → [Text] Source #

inits ∷ Text → [Text] Source #

initTails ∷ Text → [(Text, Text)] Source #

SemiSequence Text 
Instance details

Defined in Data.Sequences

Associated Types

type Index Text Source #

Textual Text 
Instance details

Defined in Data.Sequences

Methods

words ∷ Text → [Text] Source #

unwords ∷ (Element seq ~ Text, MonoFoldable seq) ⇒ seq → Text Source #

lines ∷ Text → [Text] Source #

unlines ∷ (Element seq ~ Text, MonoFoldable seq) ⇒ seq → Text Source #

toLower ∷ Text → Text Source #

toUpper ∷ Text → Text Source #

toCaseFold ∷ Text → Text Source #

breakWord ∷ Text → (Text, Text) Source #

breakLine ∷ Text → (Text, Text) Source #

Flat Text Source #

Text (and Data.Text.Lazy) is encoded as a byte aligned array of bytes corresponding to its UTF8 encoding.

>>> tt $ T.pack ""
(True,[1,0])
>>> tt $ T.pack "aaa"
(True,[1,3,97,97,97,0])
>>> tt $ T.pack "¢¢¢"
(True,[1,6,194,162,194,162,194,162,0])
>>> tt $ T.pack "日日日"
(True,[1,9,230,151,165,230,151,165,230,151,165,0])
>>> tt $ T.pack "𐍈𐍈𐍈"
(True,[1,12,240,144,141,136,240,144,141,136,240,144,141,136,0])

Strict and Lazy Text have the same encoding:

>>> tst (T.pack "abc") == tst (TL.pack "abc")
True
Instance details

Defined in PlutusCore.Flat.Instances.Text

LazySequence Text Text 
Instance details

Defined in Data.Sequences

Utf8 Text ByteString 
Instance details

Defined in Data.Sequences

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char
type Element Text 
Instance details

Defined in Data.MonoTraversable

type Index Text 
Instance details

Defined in Data.Sequences

type Index Text = Int