Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extract Haskell values from running STG programs.
- class FromStg value where
- data FromStgError
Documentation
class FromStg value where Source #
Look up the value of a global variable.
Instances of this class should have a corresponding ToStg
instance to
inject a value into the program, with the two being inverse to each other (up
to forcing the generated thunks).
fromStg :: StgState -> Var -> Either FromStgError value Source #
Retrieve the value of a global variable.
fromStgAddr :: StgState -> MemAddr -> Either FromStgError value Source #
Retrieve the value of a heap address.
fromStgPrim :: Integer -> Either FromStgError value Source #
Used only for looking up primitive integers.
FromStg Bool Source # | |
FromStg Integer Source # | Works for both boxed ( |
FromStg () Source # | |
FromStg a => FromStg [a] Source # | |
FromStg a => FromStg (Maybe a) Source # | |
(FromStg a, FromStg b) => FromStg (Either a b) Source # | |
(FromStg a, FromStg b) => FromStg (a, b) Source # | |
(FromStg a, FromStg b, FromStg c) => FromStg (a, b, c) Source # | |
(FromStg a, FromStg b, FromStg c, FromStg d) => FromStg (a, b, c, d) Source # | |
(FromStg a, FromStg b, FromStg c, FromStg d, FromStg e) => FromStg (a, b, c, d, e) Source # | |
data FromStgError Source #
Classifies the different errors that can happen when extracting a value from an STG state.
TypeMismatch | e.g. asking for an |
IsWrongLambdaType LambdaType | Tried retrieving a non-constructor |
IsBlackhole | Tried retrieving a black hole |
BadArity | e.g. |
NotFound NotInScope | An unsuccessful variable lookup |
AddrNotOnHeap | |
NoConstructorMatch | None of the given alternatives matched the given
constructor, e.g. when trying to receive a |