Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- readContract :: forall cp st. Each '[SingI] [cp, st] => FilePath -> Text -> Either ImportContractError (Contract cp st)
- readSomeContract :: FilePath -> Text -> Either ImportContractError SomeContract
- readUntypedContract :: FilePath -> Text -> Either ImportContractError Contract
- importContract :: forall cp st. Each '[SingI] [cp, st] => FilePath -> IO (Contract cp st)
- importSomeContract :: FilePath -> IO SomeContract
- importUntypedContract :: FilePath -> IO Contract
- data ImportContractError
- readValue :: forall t. SingI t => FilePath -> Text -> Either ImportValueError (Value t)
- importValue :: forall t. SingI t => FilePath -> IO (Value t)
- importSomeValue :: Ty -> FilePath -> IO SomeValue
- importUntypedValue :: FilePath -> IO Value
- data ImportValueError
- importUsing :: Exception e => (FilePath -> Text -> Either e a) -> FilePath -> IO a
Read, parse, typecheck contract
readContract :: forall cp st. Each '[SingI] [cp, st] => FilePath -> Text -> Either ImportContractError (Contract cp st) Source #
Purely read a typed contract from Michelson textual representation, failing if parameter or storage types mismatch with the expected ones.
readSomeContract :: FilePath -> Text -> Either ImportContractError SomeContract Source #
Purely read a typed contract from Michelson textual representation.
readUntypedContract :: FilePath -> Text -> Either ImportContractError Contract Source #
Purely read an untyped contract from Michelson textual representation.
FilePath
is accepted solely as a hint for error messages.
importContract :: forall cp st. Each '[SingI] [cp, st] => FilePath -> IO (Contract cp st) Source #
Import contract from a given file path.
This function reads file, parses and type checks a contract. Within the typechecking we assume that no contracts are originated, otherwise a type checking error will be caused.
This function may throw IOException
and ImportContractError
.
importSomeContract :: FilePath -> IO SomeContract Source #
Version of importContract
that doesn't require you to know
contract's parameter and storage types.
importUntypedContract :: FilePath -> IO Contract Source #
Import untyped contract from a given file path.
This function reads file, and parses a contract.
This function may throw IOException
and ImportContractError
.
data ImportContractError Source #
Error type for importContract
function.
Instances
Eq ImportContractError Source # | |
Defined in Michelson.Runtime.Import (==) :: ImportContractError -> ImportContractError -> Bool # (/=) :: ImportContractError -> ImportContractError -> Bool # | |
Show ImportContractError Source # | |
Defined in Michelson.Runtime.Import showsPrec :: Int -> ImportContractError -> ShowS # show :: ImportContractError -> String # showList :: [ImportContractError] -> ShowS # | |
Exception ImportContractError Source # | |
Buildable ImportContractError Source # | |
Defined in Michelson.Runtime.Import build :: ImportContractError -> Builder # |
Read, parse, typecheck value
readValue :: forall t. SingI t => FilePath -> Text -> Either ImportValueError (Value t) Source #
Purely read a typed Michelson value from textual representation.
importValue :: forall t. SingI t => FilePath -> IO (Value t) Source #
Import a typed value from a given file path.
importSomeValue :: Ty -> FilePath -> IO SomeValue Source #
Import a typed value from a given file path.
Expected type is provided explicitly.
data ImportValueError Source #
Error type for importValue
function.
Instances
Eq ImportValueError Source # | |
Defined in Michelson.Runtime.Import (==) :: ImportValueError -> ImportValueError -> Bool # (/=) :: ImportValueError -> ImportValueError -> Bool # | |
Show ImportValueError Source # | |
Defined in Michelson.Runtime.Import showsPrec :: Int -> ImportValueError -> ShowS # show :: ImportValueError -> String # showList :: [ImportValueError] -> ShowS # | |
Exception ImportValueError Source # | |
Defined in Michelson.Runtime.Import | |
Buildable ImportValueError Source # | |
Defined in Michelson.Runtime.Import build :: ImportValueError -> Builder # |