-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Re-export of Shake using well-typed paths and ReaderT. -- -- Re-export of Shake using well-typed paths and ReaderT. You can thread -- logging through your Shake Actions, and better keep track of source -- and output folders using the Within type. @package shake-plus @version 0.1.0.2 module Development.Shake.Plus.Core -- | Monads in which Actions may be embedded. class MonadIO m => MonadAction m liftAction :: MonadAction m => Action a -> m a class Monad m => MonadRules m liftRules :: MonadRules m => Rules a -> m a newtype UnliftAction m UnliftAction :: (forall a. m a -> Action a) -> UnliftAction m [unliftAction] :: UnliftAction m -> forall a. m a -> Action a -- | Monads which allow their actions to be run in Action. -- -- For the same reasons as MonadUnliftIO this is limited to -- ReaderT and IdentityT transformers on top of -- Action. class MonadAction m => MonadUnliftAction m withRunInAction :: MonadUnliftAction m => ((forall a. m a -> Action a) -> Action b) -> m b withUnliftAction :: MonadUnliftAction m => (UnliftAction m -> Action a) -> m a askUnliftAction :: MonadUnliftAction m => m (UnliftAction m) toAction :: MonadUnliftAction m => m a -> m (Action a) -- | Concrete Action runner, hardcoded to `ReaderT r Action a`. data RAction r a -- | Concrete Rules collector, hardcoded to `ReaderT r Rules a`. data ShakePlus r a -- | Run an RAction with an environment, consuming it for a result. runRAction :: MonadAction m => env -> RAction env a -> m a -- | Run a ShakePlus with an environment, consuming it for some -- Shake Rules. runShakePlus :: MonadRules m => env -> ShakePlus env a -> m a -- | The Action monad, use liftIO to raise IO actions -- into it, and need to execute files. Action values are used by -- addUserRule and action. The Action monad -- tracks the dependencies of a rule. To raise an exception call -- error, MonadFail or liftIO . -- throwIO. data Action a -- | Define a set of rules. Rules can be created with calls to functions -- such as %> or action. Rules are combined with either -- the Monoid instance, or (more commonly) the Monad -- instance and do notation. To define your own custom types of -- rule, see Development.Shake.Rule. data Rules a -- | A type synonym for file patterns, containing // and -- *. For the syntax and semantics of FilePattern see -- ?==. -- -- Most normaliseExd FilePath values are suitable as -- FilePattern values which match only that specific file. On -- Windows \ is treated as equivalent to /. -- -- You can write FilePattern values as a literal string, or build -- them up using the operators <.>, </> and -- <//>. However, beware that: -- -- type FilePattern = String -- | Main entry point for running Shake build systems. For an example see -- the top of the module Development.Shake. Use -- ShakeOptions to specify how the system runs, and Rules -- to specify what to build. The function will throw an exception if the -- build fails. -- -- To use command line flags to modify ShakeOptions see -- shakeArgs. shake :: ShakeOptions -> Rules () -> IO () -- | The default set of ShakeOptions. shakeOptions :: ShakeOptions instance Development.Shake.Plus.Core.MonadRules (Development.Shake.Plus.Core.ShakePlus r) instance Control.Monad.IO.Class.MonadIO (Development.Shake.Plus.Core.ShakePlus r) instance Control.Monad.Reader.Class.MonadReader r (Development.Shake.Plus.Core.ShakePlus r) instance GHC.Base.Monad (Development.Shake.Plus.Core.ShakePlus r) instance GHC.Base.Applicative (Development.Shake.Plus.Core.ShakePlus r) instance GHC.Base.Functor (Development.Shake.Plus.Core.ShakePlus r) instance Control.Monad.Fail.MonadFail (Development.Shake.Plus.Core.RAction r) instance Development.Shake.Plus.Core.MonadUnliftAction (Development.Shake.Plus.Core.RAction r) instance Development.Shake.Plus.Core.MonadAction (Development.Shake.Plus.Core.RAction r) instance Control.Monad.IO.Class.MonadIO (Development.Shake.Plus.Core.RAction r) instance Control.Monad.Reader.Class.MonadReader r (Development.Shake.Plus.Core.RAction r) instance GHC.Base.Monad (Development.Shake.Plus.Core.RAction r) instance GHC.Base.Applicative (Development.Shake.Plus.Core.RAction r) instance GHC.Base.Functor (Development.Shake.Plus.Core.RAction r) instance Control.Monad.Catch.MonadThrow (Development.Shake.Plus.Core.ShakePlus r) instance Control.Monad.Catch.MonadThrow (Development.Shake.Plus.Core.RAction r) instance Development.Shake.Plus.Core.MonadRules Development.Shake.Internal.Core.Rules.Rules instance Development.Shake.Plus.Core.MonadRules m => Development.Shake.Plus.Core.MonadRules (Control.Monad.Trans.Reader.ReaderT r m) instance Development.Shake.Plus.Core.MonadUnliftAction Development.Shake.Internal.Core.Types.Action instance Development.Shake.Plus.Core.MonadUnliftAction m => Development.Shake.Plus.Core.MonadUnliftAction (Control.Monad.Trans.Reader.ReaderT r m) instance Development.Shake.Plus.Core.MonadAction Development.Shake.Internal.Core.Types.Action instance Development.Shake.Plus.Core.MonadAction m => Development.Shake.Plus.Core.MonadAction (Control.Monad.Trans.Reader.ReaderT r m) module Development.Shake.Plus.Config -- | Lifted readConfigFile with well-typed path. readConfigFile :: MonadIO m => Path a File -> m (HashMap String String) -- | Lifted readConfigFileWithEnv with well-typed path. readConfigFileWithEnv :: MonadIO m => [(String, String)] -> Path a File -> m (HashMap String String) -- | Lifted usingConfigFile with well-typed path. usingConfigFile :: MonadRules m => Path a File -> m () -- | Lifted usingConfig. usingConfig :: MonadRules m => HashMap String String -> m () -- | Lifted getConfig. getConfig :: MonadAction m => String -> m (Maybe String) -- | Lifted getConfigKeys. getConfigKeys :: MonadAction m => m [String] module Development.Shake.Plus.Cache -- | Lifted version of newCache using RAction. newCache :: (MonadRules m, MonadReader r m, Eq k, Hashable k) => (k -> RAction r v) -> m (k -> RAction r v) -- | Lifted version of newCacheIO using RAction. newCacheIO :: (MonadIO m, MonadReader r m, Eq k, Hashable k) => (k -> RAction r v) -> m (k -> RAction r v) module Development.Shake.Plus.Database -- | The type of an open Shake database. Created with -- shakeOpenDatabase or shakeWithDatabase. Used with -- shakeRunDatabase. You may not execute simultaneous calls using -- ShakeDatabase on separate threads (it will raise an error). data ShakeDatabase -- | Lifted shakeOpenDatabase shakeOpenDatabase :: MonadIO m => ShakeOptions -> Rules () -> m (IO ShakeDatabase, IO ()) -- | Unlifted shakeWithDatabase shakeWithDatabase :: MonadUnliftIO m => ShakeOptions -> Rules () -> (ShakeDatabase -> m a) -> m a -- | Lifted shakeOneShotDatabase shakeOneShotDatabase :: MonadIO m => ShakeDatabase -> m () -- | Lifted shakeRunDatabase shakeRunDatabase :: MonadIO m => ShakeDatabase -> [Action a] -> m ([a], [IO ()]) -- | Lifted shakeLiveFilesDatabase shakeLiveFilesDatabase :: MonadIO m => ShakeDatabase -> m [FilePath] -- | Lifted shakeProfileDatabase with well-typed path. shakeProfileDatabase :: MonadIO m => ShakeDatabase -> Path a File -> m () -- | Lifted shakeErrorsDatabase shakeErrorsDatabase :: MonadIO m => ShakeDatabase -> m [(String, SomeException)] -- | Unlifted shakeRunAfter shakeRunAfter :: MonadUnliftIO m => ShakeOptions -> [m ()] -> m () module Development.Shake.Plus.Directory -- | Lifted version of doesFileExist using well-typed Paths. doesFileExist :: MonadAction m => Path b File -> m Bool -- | Lifted version of doesDirectoryExist using well-typed -- Paths. doesDirectoryExist :: MonadAction m => Path b Dir -> m Bool -- | Lifted version of getDirectoryFiles using well-typed -- Paths. getDirectoryFiles :: MonadAction m => Path b Dir -> [FilePattern] -> m [Path Rel File] -- | Like getDirectoryFiles, but returns a Within contaning a -- list of Paths. getDirectoryFilesWithin :: MonadAction m => Path b Dir -> [FilePattern] -> m (Within b [Path Rel File]) -- | Like getDirectoryFilesWithin, but returns a list of -- Within values instead of a Within` of a list. getDirectoryFilesWithin' :: MonadAction m => Path b Dir -> [FilePattern] -> m [Within b (Path Rel File)] -- | Lifted version of getDirectoryDirs using well-typed -- Paths. getDirectoryDirs :: MonadAction m => Path b Dir -> m [Path Rel Dir] -- | Lifted version of getDirectoryFilesIO using well-typed -- Paths. getDirectoryFilesIO :: MonadIO m => Path b Dir -> [FilePattern] -> m [Path Rel File] module Development.Shake.Plus.File -- | Lifted version of copyFile with well-typed Paths. copyFile' :: (MonadAction m, Partial) => Path Rel File -> Path Rel File -> m () -- | Lifted version of copyFileChanged' with well-typed -- Paths. copyFileChanged :: (MonadAction m, Partial) => Path Rel File -> Path Rel File -> m () -- | Lifted version of readFile' with well-typed Path. readFile' :: (MonadAction m, Partial) => Path Rel File -> m Text -- | Lifted version of readFileLines with well-typed Path. readFileLines :: (MonadAction m, Partial) => Path Rel File -> m [Text] -- | Like readFile', but with an argument for the parent directory. -- Used for symmetry with the way getDirectoryFiles takes -- arguments. readFileIn' :: MonadAction m => Path Rel Dir -> Path Rel File -> m Text -- | Like readFile', but accepts a Within value. readFileWithin :: MonadAction m => Within Rel (Path Rel File) -> m Text -- | Lifted version of writeFile with well-typed Path. writeFile' :: (MonadAction m, Partial) => Path Rel File -> Text -> m () -- | Lifted version of writeFileLines with well-typed Path. writeFileLines :: (MonadAction m, Partial) => Path Rel File -> [Text] -> m () -- | Like writeFile', but with an argument for the parent directory. -- Used for symmetry with the way getDirectoryFiles takes -- arguments. writeFileIn' :: MonadAction m => Path Rel Dir -> Path Rel File -> Text -> m () -- | Like writeFile', but accepts a Within value. writeFileWithin :: MonadAction m => Within Rel (Path Rel File) -> Text -> m () -- | Lifted version of writeFileChanged with well-typed Path. writeFileChanged :: (MonadAction m, Partial) => Path b File -> Text -> m () -- | Like writeFileChanged', but with an argument for the parent -- directory. Used for symmetry with the way getDirectoryFiles -- takes arguments. writeFileChangedIn :: MonadAction m => Path Rel Dir -> Path Rel File -> Text -> m () -- | Like writeFileChanged', but accepts a Within value. writeFileChangedWithin :: MonadAction m => Within Rel (Path Rel File) -> Text -> m () -- | Lifted version of removeFiles with well-typed Path. removeFiles :: MonadAction m => Path b File -> [FilePattern] -> m () -- | Lifted version of removeFilesAfter with well-typed Path. removeFilesAfter :: MonadAction m => Path Rel Dir -> [FilePattern] -> m () module Development.Shake.Plus.FileRules -- | Lifted version of need, This still uses Strings because -- it may refer to a phony rule. For the Path specific version use -- needP need :: (Partial, MonadAction m) => [String] -> m () -- | Lifted version of want. This still uses Strings because -- it may refer to a phony rule. For the Path specific version use -- wantP. want :: (Partial, MonadRules m) => [String] -> m () -- | Lifted version of need using well-typed Paths needP :: (Partial, MonadAction m) => [Path Rel File] -> m () -- | Lifted version of want using well-typed Paths wantP :: (Partial, MonadRules m) => [Path Rel File] -> m () -- | Like needP, but accepts Paths relative to the first -- argument. needIn :: (Partial, MonadAction m) => Path Rel Dir -> [Path Rel File] -> m () -- | Like wantP, but accepts Paths relative to the first -- argument. wantIn :: (Partial, MonadRules m) => Path Rel Dir -> [Path Rel File] -> m () -- | Lifted version of %> using well-typed Paths (%>) :: (Partial, MonadReader r m, MonadRules m) => FilePattern -> (Path Rel File -> RAction r ()) -> m () -- | Lifted version of |%> using well-typed Paths (|%>) :: (Partial, MonadReader r m, MonadRules m) => [FilePattern] -> (Path Rel File -> RAction r ()) -> m () -- | Within variant of `(%>)`, used to keep track of local -- directories. (%^>) :: (Partial, MonadReader r m, MonadRules m) => Within Rel FilePattern -> (Within Rel (Path Rel File) -> RAction r ()) -> m () -- | Within variant of `(%>)`, used to keep track of local -- directories. (|%^>) :: (Partial, MonadReader r m, MonadRules m) => Within Rel [FilePattern] -> (Within Rel (Path Rel File) -> RAction r ()) -> m () -- | Lifted version of phony using RAction phony :: (MonadReader r m, MonadRules m) => String -> RAction r () -> m () module Development.Shake.Plus.Loaders -- | Load a directory of FilePatterns via some loading function. -- This should be a newCache operation that takes full filepaths. batchLoad :: MonadAction m => Path b Dir -> [FilePattern] -> (Path b File -> m a) -> m (HashMap (Path Rel File) a) -- | Like batchLoad, but returns an Within of a Dir -- containing the HashMap batchLoadWithin :: MonadAction m => Path b Dir -> [FilePattern] -> (Path b File -> m a) -> m (Within b (HashMap (Path Rel File) a)) -- | Like batchLoadWithin', but returns a HashMap containing -- Within values instead of an Within of a -- Hashmap. batchLoadWithin' :: MonadAction m => Path b Dir -> [FilePattern] -> (Path b File -> m a) -> m (HashMap (Within b (Path Rel File)) a) module Development.Shake.Plus.Oracle -- | Lifted version of addOracle using RAction runner. addOracle :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of addOracleCache using RAction runner. addOracleCache :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of addOracleHash using RAction runner. addOracleHash :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of askOracle. askOracle :: (MonadAction m, RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> m a -- | Lifted version of askOracles. askOracles :: (MonadAction m, RuleResult q ~ a, ShakeValue q, ShakeValue a) => [q] -> m [a] module Development.Shake.Plus.Temp -- | Unlifted version of withTempFile with well-typed Path. withTempFile :: (MonadUnliftAction m, MonadThrow m) => (Path Rel File -> m a) -> m a -- | Unlifted version of withTempFile with well-typed Path. withTempDir :: (MonadUnliftAction m, MonadThrow m) => (Path Rel Dir -> m a) -> m a -- | Unlifted version of withTempFileWithin with well-typed -- Paths. withTempFileWithin :: (MonadUnliftAction m, MonadThrow m) => Path b Dir -> (Path Rel File -> m a) -> m a -- | Unlifted version of withTempDirWithin with well-typed -- Paths. withTempDirWithin :: (MonadUnliftAction m, MonadThrow m) => Path b Dir -> (Path Rel Dir -> m a) -> m a module Development.Shake.Plus module Development.Shake.Plus.Env -- | Lifted version of getEnv getEnv :: MonadAction m => String -> m (Maybe String) -- | Lifted version of getEnvWithDefault getEnvWithDefault :: MonadAction m => String -> String -> m String -- | Lifted version of getEnvError getEnvError :: (Partial, MonadAction m) => String -> m String