Safe Haskell | None |
---|---|
Language | GHC2021 |
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
- programDependenciesAndQueries :: forall b m. (MonadIO m, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> SpecTableName -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b))
- runProgramReal :: (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Maybe (IORef [(DumpItem b, UTCTime)]) -> Ref Table -> SpecProgram' b a -> m (Either NapkinEffectError a)
- runGlobalHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> Maybe (IORef [(DumpItem b, UTCTime)]) -> GlobalHookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a)))
- runHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => Ref Table -> RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> Maybe (IORef [(DumpItem b, UTCTime)]) -> HookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a)))
- interceptDiscoverDependencies :: forall b (r :: EffectRow) (rs :: [(Type -> Type) -> Type -> Type]) a. (Members '[Assertion :: (Type -> Type) -> Type -> Type, AnnotateWrite b :: (Type -> Type) -> Type -> Type, AnnotateRead b :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b, SqlWrite b :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type, Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r, r ~ (BackendSpecificEffect b ': ((External :: (Type -> Type) -> Type -> Type) ': ((SqlWrite b :: (Type -> Type) -> Type -> Type) ': ((SqlRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite b :: (Type -> Type) -> Type -> Type) ': rs)))))), DumpBackendRequirements b, RunBackendEffect b) => Sem ((Output ExtraDependencies :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a)
- runTableEnv :: forall (r :: EffectRow) a. Members '[Input UTCTime :: (Type -> Type) -> Type -> Type, Input RandomToken :: (Type -> Type) -> Type -> Type] r => QueryTransformer -> TargetName -> Sem ('[Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, Reader TargetName, Reader HiddenArtifacts, Reader HiddenDependencies] ++ r) a -> Sem r a
- runSqlFake :: forall bk (r :: EffectRow) a. (Members '[Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Input RandomToken :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, RunBackendEffect bk) => TargetExists -> Sem (BackendSpecificEffect bk ': ((External :: (Type -> Type) -> Type -> Type) ': ((SqlWrite bk :: (Type -> Type) -> Type -> Type) ': ((SqlRead bk :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead bk :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite bk :: (Type -> Type) -> Type -> Type) ': r)))))) a -> Sem r (IState, a)
- runSqlReal :: forall b (r :: EffectRow) a (m :: Type -> Type). (Members '[Embed m, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Assertion :: (Type -> Type) -> Type -> Type, Time :: (Type -> Type) -> Type -> Type] r, SqlReadIO m b, SqlWriteIO m b, AnnotateWriteIO m b, AnnotateReadIO m b, TemplateIO m b, DumpBackendRequirements b, RunBackendEffect b) => BackendConn b -> RuntimeEnv -> Maybe (IORef [(DumpItem b, UTCTime)]) -> Sem (BackendSpecificEffect b ': ((External :: (Type -> Type) -> Type -> Type) ': ((Template :: (Type -> Type) -> Type -> Type) ': ((SqlWrite b :: (Type -> Type) -> Type -> Type) ': ((SqlRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite b :: (Type -> Type) -> Type -> Type) ': r))))))) a -> Sem r a
- runSqlParsing :: forall b (r :: EffectRow) (m :: Type -> Type) a. (TemplateIO m b, Members '[Embed m, SqlWrite b :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Error NapkinEffectError :: (Type -> Type) -> Type -> Type] r) => RuntimeEnv -> ExternMacros -> SQLDialect -> Maybe (Sem ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))) a -> Sem ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))) a) -> Sem (Reader ConnectionString ': ((LoadQuery :: (Type -> Type) -> Type -> Type) ': ((LocalFile :: (Type -> Type) -> Type -> Type) ': ((Template :: (Type -> Type) -> Type -> Type) ': ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))))))) a -> Sem r a
- runOutputListIORefWithTS :: forall o (r :: EffectRow) a (n :: Type -> Type). (Member (Embed n) r, MonadIO n, Member (Time :: (Type -> Type) -> Type -> Type) r) => IORef [(o, UTCTime)] -> Sem ((Output o :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a
- runCoreFake :: forall (m :: Type -> Type) (r :: EffectRow) a. (Member (Embed m) r, MonadIO m) => Sem ((Input RandomToken :: (Type -> Type) -> Type -> Type) ': ((Time :: (Type -> Type) -> Type -> Type) ': ((Log :: (Type -> Type) -> Type -> Type) ': r))) a -> Sem r a
- runCoreReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Member (Embed m) r, Katip m) => LogItem -> Sem ((Input RandomToken :: (Type -> Type) -> Type -> Type) ': ((Time :: (Type -> Type) -> Type -> Type) ': ((Log :: (Type -> Type) -> Type -> Type) ': r))) a -> Sem r a
- runTransformedTargetName :: forall (r :: EffectRow) a. Members '[Reader TargetName, Reader QueryTransformer] r => Sem ((Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a
- runTransformedHiddenDependencies :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, Reader QueryTransformer] r => Sem ((Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a
- runTransformedHiddenArtifacts :: forall (r :: EffectRow) a. Members '[Reader HiddenArtifacts, Reader QueryTransformer] r => Sem ((Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a
Documentation
programDependenciesAndQueries :: forall b m. (MonadIO m, MustacheBackend b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> SpecTableName -> SpecProgram b -> m (Either NapkinEffectError (ProgramDependenciesAndQueries b)) #
Merely extracts all detectable dependencies out of the program.
runProgramReal :: (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> Maybe (IORef [(DumpItem b, UTCTime)]) -> Ref Table -> SpecProgram' b a -> m (Either NapkinEffectError a) #
Actually executes the given program
runGlobalHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> Maybe (IORef [(DumpItem b, UTCTime)]) -> GlobalHookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a))) #
runHookProgramReal :: forall b m a. (AnnotateWriteIO m b, AnnotateReadIO m b, SqlWriteIO m b, SqlReadIO m b, TemplateIO m b, RunBackendEffect b, DumpBackendRequirements b) => Ref Table -> RuntimeEnv -> InterpretedSpecEnvironment -> BackendConn b -> LogItem -> Maybe (IORef [(DumpItem b, UTCTime)]) -> HookProgram' b a -> m (Either NapkinEffectError (Either (NonEmpty AssertionEntry) ([AssertionEntry], a))) #
interceptDiscoverDependencies :: forall b (r :: EffectRow) (rs :: [(Type -> Type) -> Type -> Type]) a. (Members '[Assertion :: (Type -> Type) -> Type -> Type, AnnotateWrite b :: (Type -> Type) -> Type -> Type, AnnotateRead b :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b, SqlWrite b :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type, Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r, r ~ (BackendSpecificEffect b ': ((External :: (Type -> Type) -> Type -> Type) ': ((SqlWrite b :: (Type -> Type) -> Type -> Type) ': ((SqlRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite b :: (Type -> Type) -> Type -> Type) ': rs)))))), DumpBackendRequirements b, RunBackendEffect b) => Sem ((Output ExtraDependencies :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r ((Dependencies, Artifacts, [DumpItem b]), a) #
runTableEnv :: forall (r :: EffectRow) a. Members '[Input UTCTime :: (Type -> Type) -> Type -> Type, Input RandomToken :: (Type -> Type) -> Type -> Type] r => QueryTransformer -> TargetName -> Sem ('[Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type, Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, Reader TargetName, Reader HiddenArtifacts, Reader HiddenDependencies] ++ r) a -> Sem r a #
runSqlFake :: forall bk (r :: EffectRow) a. (Members '[Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Input RandomToken :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r, RunBackendEffect bk) => TargetExists -> Sem (BackendSpecificEffect bk ': ((External :: (Type -> Type) -> Type -> Type) ': ((SqlWrite bk :: (Type -> Type) -> Type -> Type) ': ((SqlRead bk :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead bk :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite bk :: (Type -> Type) -> Type -> Type) ': r)))))) a -> Sem r (IState, a) #
runSqlReal :: forall b (r :: EffectRow) a (m :: Type -> Type). (Members '[Embed m, FatalError :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Assertion :: (Type -> Type) -> Type -> Type, Time :: (Type -> Type) -> Type -> Type] r, SqlReadIO m b, SqlWriteIO m b, AnnotateWriteIO m b, AnnotateReadIO m b, TemplateIO m b, DumpBackendRequirements b, RunBackendEffect b) => BackendConn b -> RuntimeEnv -> Maybe (IORef [(DumpItem b, UTCTime)]) -> Sem (BackendSpecificEffect b ': ((External :: (Type -> Type) -> Type -> Type) ': ((Template :: (Type -> Type) -> Type -> Type) ': ((SqlWrite b :: (Type -> Type) -> Type -> Type) ': ((SqlRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateRead b :: (Type -> Type) -> Type -> Type) ': ((AnnotateWrite b :: (Type -> Type) -> Type -> Type) ': r))))))) a -> Sem r a #
runSqlParsing :: forall b (r :: EffectRow) (m :: Type -> Type) a. (TemplateIO m b, Members '[Embed m, SqlWrite b :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Error NapkinEffectError :: (Type -> Type) -> Type -> Type] r) => RuntimeEnv -> ExternMacros -> SQLDialect -> Maybe (Sem ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))) a -> Sem ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))) a) -> Sem (Reader ConnectionString ': ((LoadQuery :: (Type -> Type) -> Type -> Type) ': ((LocalFile :: (Type -> Type) -> Type -> Type) ': ((Template :: (Type -> Type) -> Type -> Type) ': ((SqlParse :: (Type -> Type) -> Type -> Type) ': ((SqlRender :: (Type -> Type) -> Type -> Type) ': (Reader SQLDialect ': r))))))) a -> Sem r a #
runOutputListIORefWithTS :: forall o (r :: EffectRow) a (n :: Type -> Type). (Member (Embed n) r, MonadIO n, Member (Time :: (Type -> Type) -> Type -> Type) r) => IORef [(o, UTCTime)] -> Sem ((Output o :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a #
runCoreFake :: forall (m :: Type -> Type) (r :: EffectRow) a. (Member (Embed m) r, MonadIO m) => Sem ((Input RandomToken :: (Type -> Type) -> Type -> Type) ': ((Time :: (Type -> Type) -> Type -> Type) ': ((Log :: (Type -> Type) -> Type -> Type) ': r))) a -> Sem r a #
runCoreReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Member (Embed m) r, Katip m) => LogItem -> Sem ((Input RandomToken :: (Type -> Type) -> Type -> Type) ': ((Time :: (Type -> Type) -> Type -> Type) ': ((Log :: (Type -> Type) -> Type -> Type) ': r))) a -> Sem r a #
runTransformedTargetName :: forall (r :: EffectRow) a. Members '[Reader TargetName, Reader QueryTransformer] r => Sem ((Input (Transformed TargetName) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a #
runTransformedHiddenDependencies :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, Reader QueryTransformer] r => Sem ((Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a #
runTransformedHiddenArtifacts :: forall (r :: EffectRow) a. Members '[Reader HiddenArtifacts, Reader QueryTransformer] r => Sem ((Input (Transformed HiddenArtifacts) :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a #