| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusTx.Builtins.HasOpaque
Contents
Synopsis
- stringToBuiltinByteString :: String -> BuiltinByteString
- stringToBuiltinString :: String -> BuiltinString
- newtype BuiltinByteStringUtf8 = BuiltinByteStringUtf8 {}
- stringToBuiltinByteStringUtf8 :: String -> BuiltinByteString
- newtype BuiltinByteStringHex = BuiltinByteStringHex {}
- stringToBuiltinByteStringHex :: String -> BuiltinByteString
- class HasToOpaque a arep | a -> arep where
- toOpaque :: a -> arep
- class HasFromOpaque arep a | arep -> a where
- fromOpaque :: arep -> a
- mkNilOpaque :: BuiltinList a
- class MkNil arep where
- mkNil :: BuiltinList arep
Documentation
newtype BuiltinByteStringUtf8 Source #
Constructors
| BuiltinByteStringUtf8 | |
Fields | |
Instances
newtype BuiltinByteStringHex Source #
Constructors
| BuiltinByteStringHex | |
Fields | |
Instances
class HasToOpaque a arep | a -> arep where Source #
A class for converting values of transparent Haskell-defined built-in types (such as (),
Bool, '[]' etc) to their opaque Plutus Tx counterparts. Instances for built-in types that are
not transparent are provided as well, simply as identities, since those types are already opaque.
Minimal complete definition
Nothing
Instances
class HasFromOpaque arep a | arep -> a where Source #
A class for converting values of opaque Plutus Tx types to their transparent Haskell-defined
counterparts (a.k.a. pattern-matchable) built-in types (such as (), Bool, '[]' etc). If no
transparent counterpart exists, then the implementation is identity.
Minimal complete definition
Nothing
Instances
mkNilOpaque :: BuiltinList a Source #
The empty list of elements of the given type that gets spotted by the plugin (grep for
mkNilOpaque in the plugin code) and replaced by the actual empty list constant for types that
are supported (a subset of built-in types).
class MkNil arep where Source #
MkNil class restricts types that can have empty list value of. This is necessary because
UPLC does not have polymorphic empty array value and type of empty array needs to be given explicitly.
Adding a new builtin type to MkNil requires making necessary changes on
compileMkNil as well.
Minimal complete definition
Nothing
Methods
mkNil :: BuiltinList arep Source #
Instances
Orphan instances
| IsString BuiltinByteString Source # | |
Methods fromString :: String -> BuiltinByteString Source # | |
| IsString BuiltinString Source # | |
Methods fromString :: String -> BuiltinString Source # | |