dyre-0.9.2: Dynamic reconfiguration in Haskell

Safe Haskell | None
Language | Haskell2010

Config.Dyre.Paths

Description

File paths of interest to Dyre, and related values.

Synopsis

- data PathsConfig = PathsConfig {
  - runningExecutable :: FilePath
  - customExecutable :: FilePath
  - configFile :: FilePath
  - libsDirectory :: FilePath
  - cacheDirectory :: FilePath
  }
- outputExecutable :: FilePath -> FilePath
- getPaths :: Params c r -> IO (FilePath, FilePath, FilePath, FilePath, FilePath)
- getPathsConfig :: Params cfg a -> IO PathsConfig
- maybeModTime :: FilePath -> IO (Maybe UTCTime)
- checkFilesModified :: PathsConfig -> IO Bool
- findHaskellFiles :: FilePath -> IO [FilePath]

# Documentation

data PathsConfig Source #

Data type to make it harder to confuse which path is which.

Constructors

PathsConfig |

Fields

- runningExecutable :: FilePath
- customExecutable :: FilePath
- configFile :: FilePath

  Where Dyre looks for the custom configuration file.

- libsDirectory :: FilePath

  `configDir/libs`. This directory gets added to the GHC include path during compilation, so use configurations can be split up into modules. Changes to files under this directory trigger recompilation.

- cacheDirectory :: FilePath

  Where the custom executable, object and interface files, errors file and other metadata get stored.

outputExecutable :: FilePath -> FilePath Source #

Determine a file name for the compiler to write to, based on the `customExecutable` path.

getPaths :: Params c r -> IO (FilePath, FilePath, FilePath, FilePath, FilePath) Source #

Return a `PathsConfig`, which records the current binary, the custom binary, the config file, and the cache directory.

getPathsConfig :: Params cfg a -> IO PathsConfig Source #

maybeModTime :: FilePath -> IO (Maybe UTCTime) Source #

Check if a file exists. If it exists, return Just the modification time. If it doesn't exist, return Nothing.

checkFilesModified :: PathsConfig -> IO Bool Source #

findHaskellFiles :: FilePath -> IO [FilePath] Source #

Recursively find Haskell files (`.hs`, `.lhs`) at the given location.