This cheatsheet summarizes the key primitives of the transient
and transient-universe
libraries in Haskell, with concise explanations and examples.
Primitive | Explanation | Example |
---|---|---|
keep |
Initializes and keeps an interactive TransIO application running. It executes the main computation and a command-line interpreter (REPL). It terminates when the computation produces an exit event (e.g., exit ). |
|
keep' |
Initializes and executes a TransIO computation for parallel processing. It does not include the console REPL. It waits for all generated threads to finish and returns a list with their results. |
main = do results <- keep' $ do r <- async (return "Task 1")<|> async (return "Task 2") liftIO $ prin |