| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Simple.SetupHooks.Rule
Description
Internal module that defines fine-grained rules for setup hooks.
Users should import SetupHooks instead.
Synopsis
- type Rule = RuleData 'User
- data RuleData (scope :: Scope) = Rule {
- ruleCommands :: !(RuleCmds scope)
- staticDependencies :: ![Dependency]
- results :: !(NonEmpty Location)
- data RuleId = RuleId {
- ruleNameSpace :: !RulesNameSpace
- ruleName :: !ShortText
- staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule
- dynamicRule :: (Typeable depsArg, Typeable depsRes, Typeable arg) => StaticPtr (Dict (Binary depsRes, Show depsRes, Eq depsRes)) -> Command depsArg (IO ([Dependency], depsRes)) -> Command arg (depsRes -> IO ()) -> [Dependency] -> NonEmpty Location -> Rule
- data RuleCommands (scope :: Scope) (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) where
- StaticRuleCommand :: forall arg (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) (scope :: Scope). If (scope == 'System) (arg ~ ByteString) () => {..} -> RuleCommands scope deps ruleCmd
- DynamicRuleCommands :: forall depsArg depsRes arg (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) (scope :: Scope). If (scope == 'System) (depsArg ~ ByteString, depsRes ~ ByteString, arg ~ ByteString) () => {..} -> RuleCommands scope deps ruleCmd
- type Command = CommandData 'User
- data CommandData (scope :: Scope) arg res = Command {}
- runCommand :: Command args res -> res
- mkCommand :: StaticPtr (Dict (Binary arg, Show arg)) -> StaticPtr (arg -> res) -> arg -> Command arg res
- data Dict c where
- type RuleCmds (scope :: Scope) = RuleCommands scope DynDepsCmd CommandData
- type RuleDynDepsCmd (scope :: Scope) = RuleCommands scope DynDepsCmd (NoCmd :: Scope -> Type -> Type -> Type)
- type RuleExecCmd (scope :: Scope) = RuleCommands scope (DepsRes :: Scope -> Type -> Type -> Type) CommandData
- newtype DynDepsCmd (scope :: Scope) depsArg depsRes = DynDepsCmd {
- dynDepsCmd :: CommandData scope depsArg (IO ([Dependency], depsRes))
- newtype DepsRes (scope :: Scope) (depsArg :: k) depsRes = DepsRes {
- depsRes :: ScopedArgument scope depsRes
- ruleDepsCmd :: forall (scope :: Scope). RuleCmds scope -> RuleDynDepsCmd scope
- runRuleDynDepsCmd :: RuleDynDepsCmd 'User -> Maybe (IO ([Dependency], ByteString))
- ruleExecCmd :: forall (scope :: Scope). SScope scope -> RuleCmds scope -> Maybe ByteString -> RuleExecCmd scope
- runRuleExecCmd :: RuleExecCmd 'User -> IO ()
- newtype Rules env = Rules {}
- data Dependency
- data RuleOutput = RuleOutput {
- outputOfRule :: !RuleId
- outputIndex :: !Word
- rules :: StaticPtr label -> (env -> RulesM ()) -> Rules env
- noRules :: RulesM ()
- data Location where
- location :: Location -> SymbolicPath Pkg 'File
- data MonitorFilePath
- data MonitorKindFile
- data MonitorKindDir
- type RulesM a = RulesT IO a
- newtype RulesT (m :: Type -> Type) a = RulesT {}
- data RulesEnv = RulesEnv {
- rulesEnvVerbosity :: !Verbosity
- rulesEnvNameSpace :: !RulesNameSpace
- computeRules :: Verbosity -> env -> Rules env -> IO (Map RuleId Rule, [MonitorFilePath])
- data Scope
- data SScope (scope :: Scope) where
- data family Static (scope :: Scope) :: Type -> Type
- type RuleBinary = RuleData 'System
- ruleBinary :: Rule -> RuleBinary
Rules
Rule
data RuleData (scope :: Scope) Source #
A rule consists of:
- an action to run to execute the rule,
- a description of the rule inputs and outputs.
Use staticRule or dynamicRule to construct a rule, overriding specific
fields, rather than directly using the Rule constructor.
Constructors
| Rule | Please use the |
Fields
| |
Instances
A unique identifier for a Rule.
Constructors
| RuleId | |
Fields
| |
staticRule :: Typeable arg => Command arg (IO ()) -> [Dependency] -> NonEmpty Location -> Rule Source #
A rule with static dependencies.
Prefer using this smart constructor instead of Rule whenever possible.
dynamicRule :: (Typeable depsArg, Typeable depsRes, Typeable arg) => StaticPtr (Dict (Binary depsRes, Show depsRes, Eq depsRes)) -> Command depsArg (IO ([Dependency], depsRes)) -> Command arg (depsRes -> IO ()) -> [Dependency] -> NonEmpty Location -> Rule Source #
A rule with dynamic dependencies.
Prefer using this smart constructor instead of Rule whenever possible.
Commands
data RuleCommands (scope :: Scope) (deps :: Scope -> Type -> Type -> Type) (ruleCmd :: Scope -> Type -> Type -> Type) where Source #
Commands to execute a rule:
- for a rule with static dependencies, a single command,
- for a rule with dynamic dependencies, a command for computing dynamic dependencies, and a command for executing the rule.
Constructors
| StaticRuleCommand | A rule with statically-known dependencies. |
Fields
| |
| DynamicRuleCommands | |
Fields
| |
Instances
| (forall res. Binary (ruleCmd 'System ByteString res), Binary (deps 'System ByteString ByteString)) => Binary (RuleCommands 'System deps ruleCmd) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: RuleCommands 'System deps ruleCmd -> Put # get :: Get (RuleCommands 'System deps ruleCmd) # putList :: [RuleCommands 'System deps ruleCmd] -> Put # | |
| (forall arg res. Binary (ruleCmd 'User arg res), forall depsArg depsRes. Binary depsRes => Binary (deps 'User depsArg depsRes)) => Binary (RuleCommands 'User deps ruleCmd) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: RuleCommands 'User deps ruleCmd -> Put # get :: Get (RuleCommands 'User deps ruleCmd) # putList :: [RuleCommands 'User deps ruleCmd] -> Put # | |
| (forall res. Eq (ruleCmd 'System ByteString res), Eq (deps 'System ByteString ByteString)) => Eq (RuleCommands 'System deps ruleCmd) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: RuleCommands 'System deps ruleCmd -> RuleCommands 'System deps ruleCmd -> Bool # (/=) :: RuleCommands 'System deps ruleCmd -> RuleCommands 'System deps ruleCmd -> Bool # | |
| (forall arg res. Eq (ruleCmd 'User arg res), forall depsArg depsRes. Eq depsRes => Eq (deps 'User depsArg depsRes)) => Eq (RuleCommands 'User deps ruleCmd) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: RuleCommands 'User deps ruleCmd -> RuleCommands 'User deps ruleCmd -> Bool # (/=) :: RuleCommands 'User deps ruleCmd -> RuleCommands 'User deps ruleCmd -> Bool # | |
| (forall arg res. Show (ruleCmd 'User arg res), forall depsArg depsRes. Show depsRes => Show (deps 'User depsArg depsRes)) => Show (RuleCommands 'User deps ruleCmd) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
type Command = CommandData 'User Source #
A command consists of a statically-known action together with a (possibly dynamic) argument to that action.
For example, the action can consist of running an executable
(such as happy or c2hs), while the argument consists of the variable
component of the command, e.g. the specific file to run happy on.
data CommandData (scope :: Scope) arg res Source #
Internal datatype used for commands, both for the Hooks API (Command)
and for the build system.
Constructors
| Command | |
Fields
| |
Instances
| arg ~ ByteString => Binary (CommandData 'System arg res) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: CommandData 'System arg res -> Put # get :: Get (CommandData 'System arg res) # putList :: [CommandData 'System arg res] -> Put # | |
| Binary (CommandData 'User arg res) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: CommandData 'User arg res -> Put # get :: Get (CommandData 'User arg res) # putList :: [CommandData 'User arg res] -> Put # | |
| arg ~ ByteString => Eq (CommandData 'System arg res) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: CommandData 'System arg res -> CommandData 'System arg res -> Bool # (/=) :: CommandData 'System arg res -> CommandData 'System arg res -> Bool # | |
| Eq (CommandData 'User arg res) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: CommandData 'User arg res -> CommandData 'User arg res -> Bool # (/=) :: CommandData 'User arg res -> CommandData 'User arg res -> Bool # | |
| Show (CommandData 'User arg res) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
runCommand :: Command args res -> res Source #
Run a Command.
mkCommand :: StaticPtr (Dict (Binary arg, Show arg)) -> StaticPtr (arg -> res) -> arg -> Command arg res Source #
Construct a command.
Prefer using this smart constructor instead of Command whenever possible.
A wrapper used to pass evidence of a constraint as an explicit value.
Helpers for executing commands
type RuleCmds (scope :: Scope) = RuleCommands scope DynDepsCmd CommandData Source #
Both the rule command and the (optional) dynamic dependency command.
type RuleDynDepsCmd (scope :: Scope) = RuleCommands scope DynDepsCmd (NoCmd :: Scope -> Type -> Type -> Type) Source #
Only the (optional) dynamic dependency command.
type RuleExecCmd (scope :: Scope) = RuleCommands scope (DepsRes :: Scope -> Type -> Type -> Type) CommandData Source #
The rule command together with the result of the (optional) dynamic dependency computation.
newtype DynDepsCmd (scope :: Scope) depsArg depsRes Source #
A dynamic dependency command.
Constructors
| DynDepsCmd | |
Fields
| |
Instances
| (arg ~ ByteString, depsRes ~ ByteString) => Binary (DynDepsCmd 'System arg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: DynDepsCmd 'System arg depsRes -> Put # get :: Get (DynDepsCmd 'System arg depsRes) # putList :: [DynDepsCmd 'System arg depsRes] -> Put # | |
| Binary (DynDepsCmd 'User depsArg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods put :: DynDepsCmd 'User depsArg depsRes -> Put # get :: Get (DynDepsCmd 'User depsArg depsRes) # putList :: [DynDepsCmd 'User depsArg depsRes] -> Put # | |
| (arg ~ ByteString, depsRes ~ ByteString) => Eq (DynDepsCmd 'System arg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: DynDepsCmd 'System arg depsRes -> DynDepsCmd 'System arg depsRes -> Bool # (/=) :: DynDepsCmd 'System arg depsRes -> DynDepsCmd 'System arg depsRes -> Bool # | |
| Eq (DynDepsCmd 'User depsArg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods (==) :: DynDepsCmd 'User depsArg depsRes -> DynDepsCmd 'User depsArg depsRes -> Bool # (/=) :: DynDepsCmd 'User depsArg depsRes -> DynDepsCmd 'User depsArg depsRes -> Bool # | |
| Show (DynDepsCmd 'User depsArg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
newtype DepsRes (scope :: Scope) (depsArg :: k) depsRes Source #
The result of a dynamic dependency computation.
Instances
| Binary (ScopedArgument scope depsRes) => Binary (DepsRes scope depsArg depsRes) Source # | |
| Eq depsRes => Eq (DepsRes scope depsArg depsRes) Source # | |
| Ord depsRes => Ord (DepsRes scope depsArg depsRes) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods compare :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> Ordering # (<) :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> Bool # (<=) :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> Bool # (>) :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> Bool # (>=) :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> Bool # max :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes # min :: DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes -> DepsRes scope depsArg depsRes # | |
| Show depsRes => Show (DepsRes scope depsArg depsRes) Source # | |
ruleDepsCmd :: forall (scope :: Scope). RuleCmds scope -> RuleDynDepsCmd scope Source #
Project out the (optional) dependency computation command, so that it can be serialised without serialising anything else.
runRuleDynDepsCmd :: RuleDynDepsCmd 'User -> Maybe (IO ([Dependency], ByteString)) Source #
Obtain the (optional) IO action that computes dynamic dependencies.
ruleExecCmd :: forall (scope :: Scope). SScope scope -> RuleCmds scope -> Maybe ByteString -> RuleExecCmd scope Source #
Project out the command for running the rule, passing in the result of the dependency computation if there was one.
runRuleExecCmd :: RuleExecCmd 'User -> IO () Source #
Obtain the IO action that executes a rule.
Collections of rules
A collection of Rules.
Use the rules smart constructor instead of directly using the Rules
constructor.
- Rules are registered using
registerRule, - Monitored files or directories are declared using
addRuleMonitors; a change in these will trigger the recomputation of all rules.
The env type parameter represents an extra argument, which usually
consists of information known to Cabal such as LocalBuildInfo and
ComponentLocalBuildInfo.
data Dependency Source #
A dependency of a rule.
Constructors
| RuleDependency !RuleOutput | A dependency on an output of another rule. |
| FileDependency !Location | A direct dependency on a file at a particular location on disk. This should not be used for files that are generated by other rules;
use |
Instances
| Structured Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Binary Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Eq Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Ord Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Methods compare :: Dependency -> Dependency -> Ordering # (<) :: Dependency -> Dependency -> Bool # (<=) :: Dependency -> Dependency -> Bool # (>) :: Dependency -> Dependency -> Bool # (>=) :: Dependency -> Dependency -> Bool # max :: Dependency -> Dependency -> Dependency # min :: Dependency -> Dependency -> Dependency # | |||||
| Generic Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Associated Types
| |||||
| Show Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Methods showsPrec :: Int -> Dependency -> ShowS # show :: Dependency -> String # showList :: [Dependency] -> ShowS # | |||||
| type Rep Dependency Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule type Rep Dependency = D1 ('MetaData "Dependency" "Distribution.Simple.SetupHooks.Rule" "Cabal-3.16.0.0-inplace" 'False) (C1 ('MetaCons "RuleDependency" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RuleOutput)) :+: C1 ('MetaCons "FileDependency" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Location))) | |||||
data RuleOutput Source #
A reference to an output of another rule.
Constructors
| RuleOutput | |
Fields
| |
Instances
| Structured RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Binary RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Eq RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule | |||||
| Ord RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Methods compare :: RuleOutput -> RuleOutput -> Ordering # (<) :: RuleOutput -> RuleOutput -> Bool # (<=) :: RuleOutput -> RuleOutput -> Bool # (>) :: RuleOutput -> RuleOutput -> Bool # (>=) :: RuleOutput -> RuleOutput -> Bool # max :: RuleOutput -> RuleOutput -> RuleOutput # min :: RuleOutput -> RuleOutput -> RuleOutput # | |||||
| Generic RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Associated Types
| |||||
| Show RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule Methods showsPrec :: Int -> RuleOutput -> ShowS # show :: RuleOutput -> String # showList :: [RuleOutput] -> ShowS # | |||||
| type Rep RuleOutput Source # | |||||
Defined in Distribution.Simple.SetupHooks.Rule type Rep RuleOutput = D1 ('MetaData "RuleOutput" "Distribution.Simple.SetupHooks.Rule" "Cabal-3.16.0.0-inplace" 'False) (C1 ('MetaCons "RuleOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "outputOfRule") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RuleId) :*: S1 ('MetaSel ('Just "outputIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word))) | |||||
Arguments
| :: StaticPtr label | unique label for this collection of rules |
| -> (env -> RulesM ()) | the computation of rules |
| -> Rules env |
Construct a collection of rules with a given label.
A label for the rules can be constructed using the static keyword,
using the StaticPointers extension.
NB: separate calls to rules should have different labels.
Example usage:
myRules :: Rules env
myRules = rules (static ()) $ \ env -> do { .. } -- use the monadic API hereRule inputs/outputs
A (fully resolved) location of a dependency or result of a rule, consisting of a base directory and of a file path relative to that base directory path.
In practice, this will be something like ,
where:Location dir (moduleNameSymbolicPath mod . "hs")
- for a file dependency,
diris one of the Cabal search directories, - for an output,
diris a directory such asautogenComponentModulesDirorcomponentBuildDir.
Constructors
| Location | |
Fields
| |
location :: Location -> SymbolicPath Pkg 'File Source #
Get a (relative or absolute) un-interpreted path to a Location.
File/directory monitoring
data MonitorFilePath Source #
A description of a file (or set of files) to monitor for changes.
Where file paths are relative they are relative to a common directory (e.g. project root), not necessarily the process current directory.
Constructors
| MonitorFile | |
Fields | |
| MonitorFileGlob | |
Fields | |
Instances
| Structured MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods structure :: Proxy MonitorFilePath -> Structure Source # structureHash' :: Tagged MonitorFilePath MD5 | |||||
| Binary MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods put :: MonitorFilePath -> Put # get :: Get MonitorFilePath # putList :: [MonitorFilePath] -> Put # | |||||
| Eq MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods (==) :: MonitorFilePath -> MonitorFilePath -> Bool # (/=) :: MonitorFilePath -> MonitorFilePath -> Bool # | |||||
| Generic MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Associated Types
Methods from :: MonitorFilePath -> Rep MonitorFilePath x # to :: Rep MonitorFilePath x -> MonitorFilePath # | |||||
| Show MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods showsPrec :: Int -> MonitorFilePath -> ShowS # show :: MonitorFilePath -> String # showList :: [MonitorFilePath] -> ShowS # | |||||
| type Rep MonitorFilePath Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types type Rep MonitorFilePath = D1 ('MetaData "MonitorFilePath" "Distribution.Simple.FileMonitor.Types" "Cabal-3.16.0.0-inplace" 'False) (C1 ('MetaCons "MonitorFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "monitorKindFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MonitorKindFile) :*: (S1 ('MetaSel ('Just "monitorKindDir") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MonitorKindDir) :*: S1 ('MetaSel ('Just "monitorPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath))) :+: C1 ('MetaCons "MonitorFileGlob" 'PrefixI 'True) (S1 ('MetaSel ('Just "monitorKindFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MonitorKindFile) :*: (S1 ('MetaSel ('Just "monitorKindDir") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MonitorKindDir) :*: S1 ('MetaSel ('Just "monitorPathGlob") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RootedGlob)))) | |||||
data MonitorKindFile Source #
Constructors
| FileExists | |
| FileModTime | |
| FileHashed | |
| FileNotExists |
Instances
| Structured MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods structure :: Proxy MonitorKindFile -> Structure Source # structureHash' :: Tagged MonitorKindFile MD5 | |||||
| Binary MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods put :: MonitorKindFile -> Put # get :: Get MonitorKindFile # putList :: [MonitorKindFile] -> Put # | |||||
| Eq MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods (==) :: MonitorKindFile -> MonitorKindFile -> Bool # (/=) :: MonitorKindFile -> MonitorKindFile -> Bool # | |||||
| Generic MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Associated Types
Methods from :: MonitorKindFile -> Rep MonitorKindFile x # to :: Rep MonitorKindFile x -> MonitorKindFile # | |||||
| Show MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods showsPrec :: Int -> MonitorKindFile -> ShowS # show :: MonitorKindFile -> String # showList :: [MonitorKindFile] -> ShowS # | |||||
| type Rep MonitorKindFile Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types type Rep MonitorKindFile = D1 ('MetaData "MonitorKindFile" "Distribution.Simple.FileMonitor.Types" "Cabal-3.16.0.0-inplace" 'False) ((C1 ('MetaCons "FileExists" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FileModTime" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FileHashed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FileNotExists" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data MonitorKindDir Source #
Constructors
| DirExists | |
| DirModTime | |
| DirNotExists |
Instances
| Structured MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods structure :: Proxy MonitorKindDir -> Structure Source # structureHash' :: Tagged MonitorKindDir MD5 | |||||
| Binary MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods put :: MonitorKindDir -> Put # get :: Get MonitorKindDir # putList :: [MonitorKindDir] -> Put # | |||||
| Eq MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods (==) :: MonitorKindDir -> MonitorKindDir -> Bool # (/=) :: MonitorKindDir -> MonitorKindDir -> Bool # | |||||
| Generic MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Associated Types
Methods from :: MonitorKindDir -> Rep MonitorKindDir x # to :: Rep MonitorKindDir x -> MonitorKindDir # | |||||
| Show MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods showsPrec :: Int -> MonitorKindDir -> ShowS # show :: MonitorKindDir -> String # showList :: [MonitorKindDir] -> ShowS # | |||||
| type Rep MonitorKindDir Source # | |||||
Defined in Distribution.Simple.FileMonitor.Types type Rep MonitorKindDir = D1 ('MetaData "MonitorKindDir" "Distribution.Simple.FileMonitor.Types" "Cabal-3.16.0.0-inplace" 'False) (C1 ('MetaCons "DirExists" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DirModTime" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DirNotExists" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
Monadic API for generation of ActionId
newtype RulesT (m :: Type -> Type) a Source #
Monad transformer for defining rules. Usually wraps the IO monad,
allowing IO actions to be performed using liftIO.
Constructors
| RulesT | |
Instances
| MonadTrans RulesT Source # | |
| Monad m => Applicative (RulesT m) Source # | |
| Functor m => Functor (RulesT m) Source # | |
| Monad m => Monad (RulesT m) Source # | |
| MonadFix m => MonadFix (RulesT m) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
| MonadIO m => MonadIO (RulesT m) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
The environment within the monadic API.
Constructors
| RulesEnv | |
Fields
| |
computeRules :: Verbosity -> env -> Rules env -> IO (Map RuleId Rule, [MonitorFilePath]) Source #
Internals
data family Static (scope :: Scope) :: Type -> Type Source #
A static pointer (in user scope) or its key (in system scope).
Instances
| Binary (Static 'System fnTy) Source # | |
| Binary (Static 'User fnTy) Source # | |
| Eq (Static 'System fnTy) Source # | |
| Eq (Static 'User fnTy) Source # | |
| Ord (Static 'System fnTy) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods compare :: Static 'System fnTy -> Static 'System fnTy -> Ordering # (<) :: Static 'System fnTy -> Static 'System fnTy -> Bool # (<=) :: Static 'System fnTy -> Static 'System fnTy -> Bool # (>) :: Static 'System fnTy -> Static 'System fnTy -> Bool # (>=) :: Static 'System fnTy -> Static 'System fnTy -> Bool # max :: Static 'System fnTy -> Static 'System fnTy -> Static 'System fnTy # min :: Static 'System fnTy -> Static 'System fnTy -> Static 'System fnTy # | |
| Ord (Static 'User fnTy) Source # | |
Defined in Distribution.Simple.SetupHooks.Rule Methods compare :: Static 'User fnTy -> Static 'User fnTy -> Ordering # (<) :: Static 'User fnTy -> Static 'User fnTy -> Bool # (<=) :: Static 'User fnTy -> Static 'User fnTy -> Bool # (>) :: Static 'User fnTy -> Static 'User fnTy -> Bool # (>=) :: Static 'User fnTy -> Static 'User fnTy -> Bool # max :: Static 'User fnTy -> Static 'User fnTy -> Static 'User fnTy # min :: Static 'User fnTy -> Static 'User fnTy -> Static 'User fnTy # | |
| Show (Static 'System fnTy) Source # | |
| Show (Static 'User fnTy) Source # | |
| newtype Static 'System fnTy Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
| newtype Static 'User fnTy Source # | |
Defined in Distribution.Simple.SetupHooks.Rule | |
type RuleBinary = RuleData 'System Source #
ruleBinary :: Rule -> RuleBinary Source #