napkin-0.5.11
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.Effects.Runtime

Description

A module to adapt our effect stack for use in Spec pipelines. Ideally, the Spec machinery would only use this module to access Effects related concerns.

Synopsis

Documentation

validateSpecProgram :: forall b m. (MonadIO m, ReifiesBackend b, MustacheBackend b, IsBackendTableMeta b, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> Ref Table -> CustomValidator -> SpecProgram b -> m (Either NapkinEffectError AssertionLog) #

Do a dry run of the program to exercise any validations that may be present.

to follow. Perhaps we can have this step cache loaded SQL files, SQL parsing, resolutions, etc and that cache can be fed to the real run to avoid re-doing expensive operations in the effect stack.

runProgramReal :: forall m b a t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, TemplateIO b m, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Ref Table -> SpecProgram' b ret -> m (Either NapkinEffectError ret) #

Actually executes the given program

runHookProgramReal :: forall b m a t1 t2 t3 t4 t5 t6 t7 t8 tr ret. (SqlWriteIO m b a t1 t2 t3 t4 t5 t6 t7 t8, SqlReadIO m b a tr, ExternalCreateIO m, TemplateIO b m, m ~ ComboT IO, RunBackendEffect b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> HookProgram' b ret -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], ret))) #

runSqlReal :: forall bk r a. _ => BackendConn bk -> RuntimeEnv -> Sem (Reader DynamicMeta ': (ExternalCreate ': (SqlWrite ': (SqlRead ': r)))) a -> Sem r a #

runCoreFake :: (Member (Embed m) r, MonadIO m) => Sem (Input RandomToken ': (Time ': (Log ': r))) a -> Sem r a #

runCoreReal :: (Member (Embed m) r, MonadIO m, Katip m) => Sem (Input RandomToken ': (Time ': (Log ': r))) a -> Sem r a #