Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Unison.Runtime.Interface
Synopsis
- startRuntime :: Bool -> RuntimeHost -> Text -> IO (Runtime Symbol)
- withRuntime :: MonadUnliftIO m => Bool -> RuntimeHost -> Text -> (Runtime Symbol -> m a) -> m a
- standalone :: CCache () -> Word64 -> IO StoredCache
- runStandalone :: Bool -> StoredCache -> CombIx -> IO (Either Error ())
- data StoredCache = SCache (EnumMap Word64 Combs) (EnumMap Word64 Reference) (EnumSet Word64) (OptInfos Reference Symbol) (EnumMap Word64 Reference) Word64 Word64 (Map Reference (SuperGroup Reference Symbol)) (Map Reference Word64) (Map Reference Word64) (Map Reference (Set Reference))
- decodeStandalone :: ByteString -> Either String (Text, Text, CombIx, StoredCache)
- data RuntimeHost
- = OneOff
- | Persistent
- type Runtime = Runtime Error DecompError
- $sel:terminate:Runtime :: Runtime e e' v -> IO ()
- getStoredCache :: MonadGet m => m StoredCache
- putStoredCache :: MonadPut m => StoredCache -> m ()
- prettyError :: Applicative f => (Word -> f (Pretty ColorText)) -> Error -> f (Pretty ColorText)
- prettyRuntimeExn :: Applicative f => (Word -> f (Pretty ColorText)) -> RuntimeExn -> f (Pretty ColorText)
- renderDecompError :: DecompError -> Pretty ColorText
- tabulateErrors :: Set DecompError -> Pretty ColorText
Documentation
startRuntime :: Bool -> RuntimeHost -> Text -> IO (Runtime Symbol) Source #
withRuntime :: MonadUnliftIO m => Bool -> RuntimeHost -> Text -> (Runtime Symbol -> m a) -> m a Source #
standalone :: CCache () -> Word64 -> IO StoredCache Source #
runStandalone :: Bool -> StoredCache -> CombIx -> IO (Either Error ()) Source #
data StoredCache Source #
A version of the Code Cache designed to be serialized to disk as standalone bytecode.
Constructors
Instances
Show StoredCache Source # | |
Defined in Unison.Runtime.Interface Methods showsPrec :: Int -> StoredCache -> ShowS # show :: StoredCache -> String # showList :: [StoredCache] -> ShowS # | |
Eq StoredCache Source # | |
Defined in Unison.Runtime.Interface |
decodeStandalone :: ByteString -> Either String (Text, Text, CombIx, StoredCache) Source #
data RuntimeHost Source #
Whether the runtime is hosted within a persistent session or as a one-off process. This affects the amount of clean-up and book-keeping the runtime does.
Constructors
OneOff | |
Persistent |
$sel:terminate:Runtime :: Runtime e e' v -> IO () Source #
Exported for tests
getStoredCache :: MonadGet m => m StoredCache Source #
putStoredCache :: MonadPut m => StoredCache -> m () Source #
error serialization (these should live in unison-cli, but they still have some call sites here)
Arguments
:: Applicative f | |
=> (Word -> f (Pretty ColorText)) | A function for displaying unisonweb/unison issue numbers (for example,
|
-> Error | |
-> f (Pretty ColorText) |
NB: The only reason this is in the unison-runtime package is because it’s used in the tests. Otherwise it should move to unison-cli.
prettyRuntimeExn :: Applicative f => (Word -> f (Pretty ColorText)) -> RuntimeExn -> f (Pretty ColorText) Source #