Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type TcInstrHandler = forall inp. Typeable inp => ExpandedInstr -> HST inp -> TypeCheckInstr (SomeInstr inp)
- type TcOriginatedContracts = Map ContractHash Type
- type TcResult inp = Either TCError (SomeInstr inp)
- data TypeCheckEnv = TypeCheckEnv {}
- type TypeCheck = ExceptT TCError (State TypeCheckEnv)
- runTypeCheck :: Type -> TcOriginatedContracts -> TypeCheck a -> Either TCError a
- type TypeCheckInstr = ReaderT InstrCallStack TypeCheck
- runTypeCheckIsolated :: TypeCheck a -> Either TCError a
- runTypeCheckInstrIsolated :: TypeCheckInstr a -> Either TCError a
- mapTCError :: (TCError -> TCError) -> TypeCheckInstr a -> TypeCheckInstr a
- tcContractParamL :: Lens' TypeCheckEnv Type
- tcContractsL :: Lens' TypeCheckEnv TcOriginatedContracts
- tcExtFramesL :: Lens' TypeCheckEnv TcExtFrames
Documentation
type TcInstrHandler = forall inp. Typeable inp => ExpandedInstr -> HST inp -> TypeCheckInstr (SomeInstr inp) Source #
type TcOriginatedContracts = Map ContractHash Type Source #
data TypeCheckEnv Source #
The typechecking state
runTypeCheck :: Type -> TcOriginatedContracts -> TypeCheck a -> Either TCError a Source #
runTypeCheckIsolated :: TypeCheck a -> Either TCError a Source #
Run type checker as if it worked isolated from other world - no access to environment of the current contract is allowed.
Use this function for test purposes only or for some utilities when environment does not matter. In particular, it is assumed that whatever we typecheck does not depend on the parameter type of the contract which is being typechecked (because there is no contract that we are typechecking).
runTypeCheckInstrIsolated :: TypeCheckInstr a -> Either TCError a Source #
Similar to runTypeCheckIsolated
, but for 'TypeCheckInstr.'
mapTCError :: (TCError -> TCError) -> TypeCheckInstr a -> TypeCheckInstr a Source #
Run TypeCheckInstr
and modify thrown errors using given functions.