| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Drasil.Build.Artifacts.FileLayout
Contents
Synopsis
- data FileLayout doc
- file :: PathSegment -> doc -> FileLayout doc
- directory :: Foldable f => PathSegment -> f (FileLayout doc) -> FileLayout doc
- writeFiles :: Renderable doc => OsPath -> FileLayout doc -> IO ()
File Layout
data FileLayout doc Source #
Container for laying out files in a single container for writing to disk. Notes:
- Polymorphic over the representation of the file contents. For
rendering, writeFiles requires the file content representation
satisfy
Renderable. - Only permits writing files/directories relative to a base path
provided. Does not permit `..`,
., nor~as directory names. - System-local path separator is forbidden from use in directory names.
- Assumes host file system is case-sensitive (i.e., recognizes
txtand `a.txt` as different paths).
Instances
| Functor FileLayout Source # | |
Defined in Drasil.Build.Artifacts.FileLayout Methods fmap :: (a -> b) -> FileLayout a -> FileLayout b # (<$) :: a -> FileLayout b -> FileLayout a # | |
Constructors
file :: PathSegment -> doc -> FileLayout doc Source #
Create a file FileLayout.
directory :: Foldable f => PathSegment -> f (FileLayout doc) -> FileLayout doc Source #
Create a directory FileLayout, optionally containing any number of nested
files.
Writing
writeFiles :: Renderable doc => OsPath -> FileLayout doc -> IO () Source #
Write a FileLayout to disk about a base path.
Disclaimer: Fails if files/directories already exist. This is problematic for case-insensitive file systems where different paths reference the same.