plutus-core-1.54.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

rnfNatural → () Source #

Eq Natural 
Instance details

Defined in GHC.Num.Natural

Methods

(==)NaturalNaturalBool Source #

(/=)NaturalNaturalBool Source #

Ord Natural 
Instance details

Defined in GHC.Num.Natural

Hashable Natural 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSaltIntNaturalInt Source #

hashNaturalInt 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

uniformRMStatefulGen g m ⇒ (Natural, Natural) → g → m Natural Source #

isInRange ∷ (Natural, Natural) → NaturalBool 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

liftQuote m ⇒ Natural → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ NaturalCode 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 #

toConstrShortByteStringConstr Source #

dataTypeOfShortByteStringDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c ShortByteString) Source #

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

gmapT ∷ (∀ b. Data b ⇒ b → b) → ShortByteStringShortByteString 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 #

gmapQiInt → (∀ d. Data d ⇒ d → u) → ShortByteString → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → ShortByteString → m ShortByteString Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → ShortByteString → m ShortByteString Source #

gmapMoMonadPlus 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

rnfShortByteString → () 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

liftQuote m ⇒ ShortByteString → m Exp Source #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ ShortByteStringCode 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

hashWithSaltIntTextInt Source #

hashTextInt 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

ofoldMapMonoid 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 #

otoListText → [Element Text] Source #

oall ∷ (Element TextBool) → TextBool Source #

oany ∷ (Element TextBool) → TextBool Source #

onullTextBool Source #

olengthTextInt Source #

olength64TextInt64 Source #

ocompareLengthIntegral 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 #

ofoldlMMonad m ⇒ (a → Element Text → m a) → a → Text → m a Source #

ofoldMap1ExSemigroup m ⇒ (Element Text → m) → Text → m Source #

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

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

headExTextElement Text Source #

lastExTextElement Text Source #

unsafeHeadTextElement Text Source #

unsafeLastTextElement Text Source #

maximumByEx ∷ (Element TextElement TextOrdering) → TextElement Text Source #

minimumByEx ∷ (Element TextElement TextOrdering) → TextElement Text Source #

oelemElement TextTextBool Source #

onotElemElement TextTextBool Source #

MonoFunctor Text 
Instance details

Defined in Data.MonoTraversable

Methods

omap ∷ (Element TextElement Text) → TextText Source #

MonoPointed Text 
Instance details

Defined in Data.MonoTraversable

Methods

opointElement TextText Source #

MonoTraversable Text 
Instance details

Defined in Data.MonoTraversable

Methods

otraverseApplicative f ⇒ (Element Text → f (Element Text)) → Text → f Text Source #

omapMApplicative m ⇒ (Element Text → m (Element Text)) → Text → m Text Source #

IsSequence Text 
Instance details

Defined in Data.Sequences

Methods

fromList ∷ [Element Text] → Text Source #

lengthIndexTextIndex Text Source #

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

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

dropWhile ∷ (Element TextBool) → TextText Source #

takeWhile ∷ (Element TextBool) → TextText Source #

splitAtIndex TextText → (Text, Text) Source #

unsafeSplitAtIndex TextText → (Text, Text) Source #

takeIndex TextTextText Source #

unsafeTakeIndex TextTextText Source #

dropIndex TextTextText Source #

unsafeDropIndex TextTextText Source #

dropEndIndex TextTextText Source #

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

unconsTextMaybe (Element Text, Text) Source #

unsnocTextMaybe (Text, Element Text) Source #

filter ∷ (Element TextBool) → TextText Source #

filterMMonad m ⇒ (Element Text → m Bool) → Text → m Text Source #

replicateIndex TextElement TextText Source #

replicateMMonad m ⇒ Index Text → m (Element Text) → m Text Source #

groupBy ∷ (Element TextElement TextBool) → Text → [Text] Source #

groupAllOnEq b ⇒ (Element Text → b) → Text → [Text] Source #

subsequencesText → [Text] Source #

permutationsText → [Text] Source #

tailExTextText Source #

tailMayTextMaybe Text Source #

initExTextText Source #

initMayTextMaybe Text Source #

unsafeTailTextText Source #

unsafeInitTextText Source #

indexTextIndex TextMaybe (Element Text) Source #

indexExTextIndex TextElement Text Source #

unsafeIndexTextIndex TextElement Text Source #

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

tailsText → [Text] Source #

initsText → [Text] Source #

initTailsText → [(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

wordsText → [Text] Source #

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

linesText → [Text] Source #

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

toLowerTextText Source #

toUpperTextText Source #

toCaseFoldTextText Source #

breakWordText → (Text, Text) Source #

breakLineText → (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