| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.Debugger.Runtime.Instances.Discover
Synopsis
Runtime DebugView instance
data DebugViewInstance Source #
A DebugView instance wrapper to call on values on the (potentially
foreign) interpreter heap
Constructors
| DebugViewInstance | |
Fields
| |
Cache for runtime instances
type RuntimeInstancesCache = TypeMap (Maybe DebugViewInstance) Source #
Cache DebugView instances found at runtime to avoid trying to find them again.
If we found that a particular type doesn't have an instance, we record that as well.
getDebugViewInstance :: Type -> Debugger (Maybe DebugViewInstance) Source #
Get a DebugViewInstance for the given type, if one exists.
Looks up in the cache and otherwise tries to find the instance.
Returns Nothing if no instance could be found.
Finding runtime instances utils
Arguments
| :: LHsExpr GhcPs | Expr of method/expr that takes dictionary |
| -> Type | The final type of expr when funct is alredy applied to dict |
| -> TcM ForeignHValue |
Try to compile and load a class method for the given type.
E.g. compileAndLoadMthd (nlHsVar "foo") ty returns the
foreign value for an expression foo applied to the dictionary required to
produce the final requested type