Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- type SpecProgram' b a = Sem (SpecProgramEffects b) a
- type HookProgram' b a = Sem (HookProgramEffects b) a
- type HookProgram b = HookProgram' b ()
- data HookSyncOrAsync
- data Hook b = Hook {}
- pattern AsyncHook :: HookProgram b -> Hook b
- pattern SyncHook :: HookProgram b -> Hook b
- type GlobalHookProgram' b a = Sem (GlobalHookProgramEffects b) a
- type GlobalHookProgram b = GlobalHookProgram' b ()
- type SpecProgram b = SpecProgram' b ()
- newtype HookProgramWithArgParser b = HookProgramWithArgParser (Object -> Parser (SpecProgramArguments, HookProgram b))
- parserlessHook :: HookProgram b -> HookProgramWithArgParser b
- newtype SpecProgramWithArgParser b = SpecProgramWithArgParser (Object -> Parser (SpecProgramArguments, SpecProgram b))
- parserlessSpec :: SpecProgram b -> SpecProgramWithArgParser b
- type SpecProgramEffects b = '[RecreateTable b :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Reader HiddenArtifacts, Assertion :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] ++ TableEffects b
- type GlobalHookProgramEffects b = '[Assertion :: (Type -> Type) -> Type -> Type, Embed IO, BackendSpecificEffect b] ++ Core b
- type HookProgramEffects b = GlobalHookProgramEffects b ++ TableEffects b
- type TableEffects b = '[Reader TargetName, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, Reader ConnectionString, External :: (Type -> Type) -> Type -> Type] ++ Core b
- type Core b = '[FatalError :: (Type -> Type) -> Type -> Type, Input RandomToken :: (Type -> Type) -> Type -> Type, Time :: (Type -> Type) -> Type -> Type, Output LogLine :: (Type -> Type) -> Type -> Type, SqlRender :: (Type -> Type) -> Type -> Type, SqlParse :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, SqlWrite b :: (Type -> Type) -> Type -> Type, AnnotateRead b :: (Type -> Type) -> Type -> Type, AnnotateWrite b :: (Type -> Type) -> Type -> Type, LocalFile :: (Type -> Type) -> Type -> Type, Template :: (Type -> Type) -> Type -> Type, LoadQuery :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Input MetaArguments :: (Type -> Type) -> Type -> Type, Reader SQLDialect, Fail :: (Type -> Type) -> Type -> Type]
- class RunBackendEffect b where
- runBackendEffectReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Members '[FatalError :: (Type -> Type) -> Type -> Type, Embed m] r, MonadNapkin b m, SqlIO m, LocalQueryStats b m) => BackendConn b -> Sem (BackendSpecificEffect b ': r) a -> Sem r a
- runBackendEffectFake :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, State IState :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => Sem (BackendSpecificEffect b ': r) a -> Sem r a
- interceptBackendEffectDiscoverDependencies :: forall (r :: EffectRow) a. Members '[Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Output Dependencies :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] r => Sem r a -> Sem r a
- interceptBackendEffectApplyQueryTransformer :: forall (r :: EffectRow) a. Members '[Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, BackendSpecificEffect b] r => Sem r a -> Sem r a
- askRefRenamer :: forall (r :: EffectRow). Member (Reader QueryTransformer) r => Sem r (Ref Table -> Ref Table)
- askQueryRewriter :: forall (r :: EffectRow). Member (Reader QueryTransformer) r => Sem r (Query -> Query)
- askQueryRewriterData :: forall a (r :: EffectRow). (Data a, Member (Reader QueryTransformer) r) => Sem r (a -> a)
- data ProgramDependenciesAndQueries (b :: k)
- = SinglePath (DryRunResult b)
- | MultiplePaths {
- createPath :: DryRunResult b
- updatePath :: DryRunResult b
- summarize :: forall {k} (b :: k). ProgramDependenciesAndQueries b -> DryRunResult b
- data DryRunResult (b :: k) = DryRunResult {
- dependencies :: Dependencies
- artifacts :: Artifacts
- queries :: [DumpItem b]
- loadedSqlQueries :: [(FilePath, Query)]
- assertions :: AssertionLog
Documentation
type SpecProgram' b a = Sem (SpecProgramEffects b) a #
type HookProgram' b a = Sem (HookProgramEffects b) a #
Programs packaged up for use in Specs. Intended for use in providing introspectable CustomCreate actions in specs.
type HookProgram b = HookProgram' b () #
Hooks have different capabilities than specs
data HookSyncOrAsync #
Instances
Generic HookSyncOrAsync # | |||||
Defined in Napkin.Run.Effects.Types
from :: HookSyncOrAsync -> Rep HookSyncOrAsync x # to :: Rep HookSyncOrAsync x -> HookSyncOrAsync # | |||||
Show HookSyncOrAsync # | |||||
Defined in Napkin.Run.Effects.Types showsPrec :: Int -> HookSyncOrAsync -> ShowS # show :: HookSyncOrAsync -> String # showList :: [HookSyncOrAsync] -> ShowS # | |||||
type Rep HookSyncOrAsync # | |||||
Defined in Napkin.Run.Effects.Types |
Hook | |
|
Instances
Generic (Hook b) # | |||||
Defined in Napkin.Run.Effects.Types
| |||||
type Rep (Hook b) # | |||||
Defined in Napkin.Run.Effects.Types type Rep (Hook b) = D1 ('MetaData "Hook" "Napkin.Run.Effects.Types" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "Hook" 'PrefixI 'True) (S1 ('MetaSel ('Just "async") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HookSyncOrAsync) :*: S1 ('MetaSel ('Just "hookProgram") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HookProgram b)))) |
pattern AsyncHook :: HookProgram b -> Hook b #
pattern SyncHook :: HookProgram b -> Hook b #
type GlobalHookProgram' b a = Sem (GlobalHookProgramEffects b) a #
type GlobalHookProgram b = GlobalHookProgram' b () #
type SpecProgram b = SpecProgram' b () #
newtype HookProgramWithArgParser b #
parserlessHook :: HookProgram b -> HookProgramWithArgParser b #
newtype SpecProgramWithArgParser b #
parserlessSpec :: SpecProgram b -> SpecProgramWithArgParser b #
type SpecProgramEffects b = '[RecreateTable b :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Reader HiddenArtifacts, Assertion :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] ++ TableEffects b #
type GlobalHookProgramEffects b = '[Assertion :: (Type -> Type) -> Type -> Type, Embed IO, BackendSpecificEffect b] ++ Core b #
type HookProgramEffects b = GlobalHookProgramEffects b ++ TableEffects b #
type TableEffects b = '[Reader TargetName, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, Reader ConnectionString, External :: (Type -> Type) -> Type -> Type] ++ Core b #
type Core b = '[FatalError :: (Type -> Type) -> Type -> Type, Input RandomToken :: (Type -> Type) -> Type -> Type, Time :: (Type -> Type) -> Type -> Type, Output LogLine :: (Type -> Type) -> Type -> Type, SqlRender :: (Type -> Type) -> Type -> Type, SqlParse :: (Type -> Type) -> Type -> Type, SqlRead b :: (Type -> Type) -> Type -> Type, SqlWrite b :: (Type -> Type) -> Type -> Type, AnnotateRead b :: (Type -> Type) -> Type -> Type, AnnotateWrite b :: (Type -> Type) -> Type -> Type, LocalFile :: (Type -> Type) -> Type -> Type, Template :: (Type -> Type) -> Type -> Type, LoadQuery :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, Input MetaArguments :: (Type -> Type) -> Type -> Type, Reader SQLDialect, Fail :: (Type -> Type) -> Type -> Type] #
class RunBackendEffect b where #
runBackendEffectReal :: forall (m :: Type -> Type) (r :: EffectRow) a. (Members '[FatalError :: (Type -> Type) -> Type -> Type, Embed m] r, MonadNapkin b m, SqlIO m, LocalQueryStats b m) => BackendConn b -> Sem (BackendSpecificEffect b ': r) a -> Sem r a #
runBackendEffectFake :: forall (r :: EffectRow) a. Members '[Reader HiddenDependencies, State IState :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => Sem (BackendSpecificEffect b ': r) a -> Sem r a #
interceptBackendEffectDiscoverDependencies :: forall (r :: EffectRow) a. Members '[Input (Transformed HiddenDependencies) :: (Type -> Type) -> Type -> Type, Output Dependencies :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b] r => Sem r a -> Sem r a #
interceptBackendEffectApplyQueryTransformer :: forall (r :: EffectRow) a. Members '[Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader QueryTransformer, BackendSpecificEffect b] r => Sem r a -> Sem r a #
Instances
askRefRenamer :: forall (r :: EffectRow). Member (Reader QueryTransformer) r => Sem r (Ref Table -> Ref Table) #
askQueryRewriter :: forall (r :: EffectRow). Member (Reader QueryTransformer) r => Sem r (Query -> Query) #
askQueryRewriterData :: forall a (r :: EffectRow). (Data a, Member (Reader QueryTransformer) r) => Sem r (a -> a) #
data ProgramDependenciesAndQueries (b :: k) #
SinglePath (DryRunResult b) | |
MultiplePaths | |
|
summarize :: forall {k} (b :: k). ProgramDependenciesAndQueries b -> DryRunResult b #
data DryRunResult (b :: k) #
DryRunResult | |
|