Dhall.Package

dhall-1.42.2: A configuration language guaranteed to terminate

Safe Haskell | None
Language | Haskell2010

Dhall.Package

Description

Create a package.dhall from files and directory contents.

Synopsis

- writePackage :: CharacterSet -> Maybe String -> NonEmpty FilePath -> IO ()
- getPackagePathAndContent :: Maybe String -> NonEmpty FilePath -> IO (FilePath, Expr s Import)
- data PackageError
  - = AmbiguousOutputDirectory FilePath FilePath
  - | IncompatiblePaths [Import]
  - | InvalidPath FilePath

# Documentation

writePackage :: CharacterSet -> Maybe String -> NonEmpty FilePath -> IO () #

Create a package.dhall from files and directory contents. For a description of how the package file is constructed see `getPackagePathAndContent`.

getPackagePathAndContent :: Maybe String -> NonEmpty FilePath -> IO (FilePath, Expr s Import) #

Get the path and the Dhall expression for a package file.

The location of the resulting package file is determined by the first path of the second argument:

- If it is a directory, it is also the output directory and the package file will be placed there.
- If it is a file, then the directory that file resides in is the output directory and the package file will be placed there.

All inputs provided as the second argument must be either in the output directory or below it. They are processed depending on whether the path points to a directory or a file:

- If the path points to a directory, all files with a `.dhall` extensions in that directory are included in the package.
- If the path points to a regular file, it is included in the package unless it is the path of the package file itself.

data PackageError #

Exception thrown when creating a package file.

Constructors

AmbiguousOutputDirectory FilePath FilePath |
IncompatiblePaths [Import] |
InvalidPath FilePath |

#### Instances

Instances details

Exception PackageError # |
Instance details Defined in Dhall.Package Methods toException :: PackageError -> SomeException # fromException :: SomeException -> Maybe PackageError # displayException :: PackageError -> String # backtraceDesired :: PackageError -> Bool #
Show PackageError # |
Instance details Defined in Dhall.Package Methods showsPrec :: Int -> PackageError -> ShowS # show :: PackageError -> String # showList :: [PackageError] -> ShowS #