Safe Haskell | None |
---|---|
Language | GHC2024 |
Synopsis
- type SpecProgram' b a = Sem (SpecProgramEffects b) a
- type HookProgram' b a = Sem (TableHookProgramEffects 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 IOGlobalHookProgram' b a = Sem (IOGlobalHookProgramEffects b) a
- type IOGlobalHookProgram b = IOGlobalHookProgram' b ()
- type PureGlobalHookProgram' b a = Sem (PureGlobalHookProgramEffects b) a
- type PureGlobalHookProgram b = PureGlobalHookProgram' 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 = (AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ TableEffects b
- type TableHookProgramEffects b = (AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ TableEffects b
- type PureGlobalHookProgramEffects b = '[External :: (Type -> Type) -> Type -> Type, Reader TableMemos, Output TableMemo :: (Type -> Type) -> Type -> Type] ++ ((AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ Core b)
- type IOGlobalHookProgramEffects b = '[Embed IO] ++ PureGlobalHookProgramEffects b
- type AssertionEffects (b :: k1) = '[Assertion :: k -> Type -> Type]
- type TableEffects b = '[Reader TargetName, RecreateTable b :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type, Output TableMemo :: (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, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b, 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, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Reader HiddenArtifacts, Input MetaArguments :: (Type -> Type) -> Type -> Type, Reader SQLDialect, Reader ConnectionString, 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
- backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]]
- 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
- summarizeWithHooks :: forall {k} (b :: k). ProgramAndHooksDependenciesAndQueries b -> 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
- type ProgramAndHooksDependenciesAndQueries (bk :: k) = (ProgramDependenciesAndQueries bk, [DryRunResult bk], [DryRunResult bk])
- data SpecDepsAndQueries (bk :: k) = SpecDepsAndQueries {}
Documentation
type SpecProgram' b a = Sem (SpecProgramEffects b) a #
type HookProgram' b a = Sem (TableHookProgramEffects 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-spec-2.0.0-7NH5JHRFo7V8BQP5NCfMo1" '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 IOGlobalHookProgram' b a = Sem (IOGlobalHookProgramEffects b) a #
type IOGlobalHookProgram b = IOGlobalHookProgram' b () #
type PureGlobalHookProgram' b a = Sem (PureGlobalHookProgramEffects b) a #
type PureGlobalHookProgram b = PureGlobalHookProgram' 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 = (AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ TableEffects b #
type TableHookProgramEffects b = (AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ TableEffects b #
type PureGlobalHookProgramEffects b = '[External :: (Type -> Type) -> Type -> Type, Reader TableMemos, Output TableMemo :: (Type -> Type) -> Type -> Type] ++ ((AssertionEffects b :: [(Type -> Type) -> Type -> Type]) ++ Core b) #
type IOGlobalHookProgramEffects b = '[Embed IO] ++ PureGlobalHookProgramEffects b #
type AssertionEffects (b :: k1) = '[Assertion :: k -> Type -> Type] #
type TableEffects b = '[Reader TargetName, RecreateTable b :: (Type -> Type) -> Type -> Type, External :: (Type -> Type) -> Type -> Type, Output TableMemo :: (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, Input TemporaryTableName :: (Type -> Type) -> Type -> Type, BackendSpecificEffect b, 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, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Reader HiddenDependencies, Reader HiddenArtifacts, Input MetaArguments :: (Type -> Type) -> Type -> Type, Reader SQLDialect, Reader ConnectionString, Fail :: (Type -> Type) -> Type -> Type] #
class RunBackendEffect b where #
runBackendEffectReal, runBackendEffectFake, interceptBackendEffectDiscoverDependencies, interceptBackendEffectApplyQueryTransformer
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 #
backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]] #
default backendDependencyValidator :: Proxy b -> [(SpecDependency -> Ref Table) -> SpecsDepsTables -> [WithSpecTable Text]] #
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 | |
|
summarizeWithHooks :: forall {k} (b :: k). ProgramAndHooksDependenciesAndQueries b -> DryRunResult b #
summarize :: forall {k} (b :: k). ProgramDependenciesAndQueries b -> DryRunResult b #
data DryRunResult (b :: k) #
DryRunResult | |
|
Instances
type ProgramAndHooksDependenciesAndQueries (bk :: k) = (ProgramDependenciesAndQueries bk, [DryRunResult bk], [DryRunResult bk]) #
data SpecDepsAndQueries (bk :: k) #
SpecDepsAndQueries | |
|
Instances
Generic (SpecDepsAndQueries bk) # | |||||
Defined in Napkin.Run.Effects.Types
from :: SpecDepsAndQueries bk -> Rep (SpecDepsAndQueries bk) x # to :: Rep (SpecDepsAndQueries bk) x -> SpecDepsAndQueries bk # | |||||
type Rep (SpecDepsAndQueries bk) # | |||||
Defined in Napkin.Run.Effects.Types type Rep (SpecDepsAndQueries bk) = D1 ('MetaData "SpecDepsAndQueries" "Napkin.Run.Effects.Types" "napkin-spec-2.0.0-7NH5JHRFo7V8BQP5NCfMo1" 'False) (C1 ('MetaCons "SpecDepsAndQueries" 'PrefixI 'True) (S1 ('MetaSel ('Just "tablesDepsAndQueries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(SpecTableName, ProgramAndHooksDependenciesAndQueries bk)]) :*: S1 ('MetaSel ('Just "hooksDepsAndQueries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, DryRunResult bk)]))) |