| Copyright | (C) 2026 Edward Kmett |
|---|---|
| License | UPL-1.0 AND BSD-3-Clause |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | GHC FFI; THC runtime services or native fallback implementation |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
THC.Runtime
Description
Read-only runtime identity and permissions. The trusted boundary consists only of fixed, validated selectors; no raw foreign values escape this module.
Synopsis
- data Available a
- = Available a
- | Unsupported
- | Disabled
- | Denied
- | Unavailable
- data RuntimeKind
- data Backend
- data RuntimeInfo = RuntimeInfo {}
- data RuntimeCapabilities = RuntimeCapabilities {}
- runtimeInfo :: IO RuntimeInfo
- runtimeCapabilities :: IO RuntimeCapabilities
Documentation
An absent metric is not zero. Queries never enable JVM-wide monitoring.
fmap transforms a genuine value and preserves every non-value status:
>>>fmap (+ 1) (Available (41 :: Int))Available 42>>>fmap (+ 1) (Disabled :: Available Int)Disabled>>>map (fmap (+ 1)) [Unsupported, Disabled, Denied, Unavailable :: Available Int][Unsupported,Disabled,Denied,Unavailable]
Constructors
| Available a | A genuine value; its scope is specified by the query. |
| Unsupported | The runtime or provider does not implement this service. |
| Disabled | Supported, but its instrumentation or sink is switched off. |
| Denied | The current context or host security policy forbids access. |
| Unavailable | Normally supported, but no value is currently available. |
Instances
| Functor Available # | |
| Eq a => Eq (Available a) # | |
| Ord a => Ord (Available a) # | |
Defined in THC.Runtime.Types | |
| Show a => Show (Available a) # | |
data RuntimeKind Source #
Runtime supplying the service ABI, independently of its selected backend.
Constructors
| NativeGHC | |
| TruffleHaskell |
Instances
| Eq RuntimeKind # | |
Defined in THC.Runtime | |
| Ord RuntimeKind # | |
Defined in THC.Runtime Methods compare :: RuntimeKind -> RuntimeKind -> Ordering # (<) :: RuntimeKind -> RuntimeKind -> Bool # (<=) :: RuntimeKind -> RuntimeKind -> Bool # (>) :: RuntimeKind -> RuntimeKind -> Bool # (>=) :: RuntimeKind -> RuntimeKind -> Bool # max :: RuntimeKind -> RuntimeKind -> RuntimeKind # min :: RuntimeKind -> RuntimeKind -> RuntimeKind # | |
| Show RuntimeKind # | |
Defined in THC.Runtime Methods showsPrec :: Int -> RuntimeKind -> ShowS # show :: RuntimeKind -> String # showList :: [RuntimeKind] -> ShowS # | |
Execution backend reported by the current runtime context.
Constructors
| NativeBackend | |
| ASTBackend | |
| BytecodeBackend |
data RuntimeInfo Source #
Version strings are informational, not feature-detection interfaces.
Constructors
| RuntimeInfo | |
Fields | |
Instances
| Eq RuntimeInfo # | |
Defined in THC.Runtime | |
| Show RuntimeInfo # | |
Defined in THC.Runtime Methods showsPrec :: Int -> RuntimeInfo -> ShowS # show :: RuntimeInfo -> String # showList :: [RuntimeInfo] -> ShowS # | |
data RuntimeCapabilities Source #
Permissions are for the current THC context, not the entire JVM. CPU capacity is the context's initial eligible capacity, not a thread count.
Constructors
| RuntimeCapabilities | |
Instances
| Eq RuntimeCapabilities # | |
Defined in THC.Runtime Methods (==) :: RuntimeCapabilities -> RuntimeCapabilities -> Bool # (/=) :: RuntimeCapabilities -> RuntimeCapabilities -> Bool # | |
| Show RuntimeCapabilities # | |
Defined in THC.Runtime Methods showsPrec :: Int -> RuntimeCapabilities -> ShowS # show :: RuntimeCapabilities -> String # showList :: [RuntimeCapabilities] -> ShowS # | |
runtimeInfo :: IO RuntimeInfo Source #
Query runtime identity and informational version strings. Each field keeps
its own Available status; native GHC has no JVM identity to report.
A client can inspect one field without assuming the others are available:
info <- runtimeInfo case runtimeKind info of Available kind -> print kind status -> print status
runtimeCapabilities :: IO RuntimeCapabilities Source #
Query context permissions and initial CPU capacity without changing them. Permission to use a service is distinct from the service being available.