Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides staticDhallExpression
which can be used to resolve
all of an expression’s imports at compile time, allowing one to reference
Dhall expressions from Haskell without having a runtime dependency on the
location of Dhall files.
For example, given a file “Some/Type.dhall” containing
: Natural | Other : ../Other/Type.dhall
rather than duplicating the AST manually in a Haskell Type
, you can do
Dhall.Type (case UnionLit This _ _ -> ... UnionLit Other _ _ -> ...) $(staticDhallExpression "....Some/Type.dhall")
This would create the Dhall Expr AST from the dhall
file at compile
time with all imports resolved, making it easy to keep your Dhall configs
and Haskell interpreters in sync.
Synopsis
- staticDhallExpression :: Text -> Q Exp