registry-0.5.0.0: data structure for assembling components
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.RIO

Description

Utilities for working with ResourceT IO

Synopsis

Documentation

type RIO = ResourceT IO Source #

Type alias for ResourceT IO

withRegistry :: forall a b ins out m. (Typeable a, Contains (RIO a) out, Solvable ins out, MonadIO m, MemoizedActions out) => Registry ins out -> (a -> IO b) -> m b Source #

This function must be used to run services involving a top component It creates an application of type a and which can return a result of type b.

We also make sure that all effects are memoized by calling memoizeAll on the Registry here!

runRegistryT :: forall a ins out. (Typeable a, Contains (RIO a) out, Solvable ins out, MemoizedActions out) => Registry ins out -> ResourceT IO a Source #

This can be used if you want to insert the component creation inside another action managed with ResourceT. Or if you want to call runResourceT yourself later