Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.8.3
It defines the Exp
monad that allows providing computation with
an ability to resolve file paths.
- data ExperimentWriter a
- runExperimentWriter :: ExperimentWriter a -> IO a
- data ExperimentFilePath
- = WritableFilePath FilePath
- | UniqueFilePath FilePath
- resolveFilePath :: FilePath -> ExperimentFilePath -> ExperimentWriter FilePath
- expandFilePath :: ExperimentFilePath -> Map String String -> ExperimentFilePath
- mapFilePath :: (FilePath -> FilePath) -> ExperimentFilePath -> ExperimentFilePath
Documentation
data ExperimentWriter a Source
Defines an IO
derived computation whithin which we can resolve the unique file paths.
Monad ExperimentWriter | |
Functor ExperimentWriter | |
Applicative ExperimentWriter | |
MonadIO ExperimentWriter |
runExperimentWriter :: ExperimentWriter a -> IO aSource
Run the ExperimentWriter
computation.
data ExperimentFilePath Source
Specifies the file name, unique or writable, which can be appended with extension if required.
WritableFilePath FilePath | The file which is overwritten in case if it existed before. |
UniqueFilePath FilePath | The file which is always unique, when an automatically generated suffix is added to the name in case of need. |
resolveFilePath :: FilePath -> ExperimentFilePath -> ExperimentWriter FilePathSource
Resolve the file path relative to the specified directory passed in the first argument and taking into account a possible requirement to have an unique file name.
expandFilePath :: ExperimentFilePath -> Map String String -> ExperimentFilePathSource
Expand the file path using the specified table of substitutions.
mapFilePath :: (FilePath -> FilePath) -> ExperimentFilePath -> ExperimentFilePathSource
Transform the file path using the specified function.