Safe Haskell | None |
---|---|
Language | Haskell2010 |
Dhall.Util
Description
Shared utility functions
Synopsis
- snip :: Text -> Text
- snipDoc :: Doc Ann -> Doc a
- insert :: Pretty a => a -> Doc Ann
- _ERROR :: IsString string => string
- data Censor
- data Input
- = StandardInput
- | InputFile FilePath
- data OutputMode
- data Output
- = StandardOutput
- | OutputFile FilePath
- getExpression :: Censor -> Input -> IO (Expr Src Import)
- getExpressionAndHeader :: Censor -> Input -> IO (Header, Expr Src Import)
- getExpressionAndHeaderFromStdinText :: Censor -> Text -> IO (Header, Expr Src Import)
- newtype Header = Header Text
- data CheckFailed = CheckFailed {}
Documentation
snipDoc :: Doc Ann -> Doc a Source #
Like snip
, but for Doc
s
Note that this has to be opinionated and render ANSI color codes, but that should be fine because we don't use this in a non-interactive context
Set to Censor
if you want to censor error text that might include secrets
data OutputMode Source #
getExpression :: Censor -> Input -> IO (Expr Src Import) Source #
Convenient utility for retrieving an expression
getExpressionAndHeader :: Censor -> Input -> IO (Header, Expr Src Import) Source #
Convenient utility for retrieving an expression along with its header
getExpressionAndHeaderFromStdinText :: Censor -> Text -> IO (Header, Expr Src Import) Source #
Convenient utility for retrieving an expression along with its header from | text already read from STDIN (so it's not re-read)
A header corresponds to the leading comment at the top of a Dhall file.
The header includes comment characters but is stripped of leading spaces and trailing newlines
data CheckFailed Source #
Exception thrown when the --check
flag to a command-line subcommand fails
Constructors
CheckFailed | |
Instances
Show CheckFailed Source # | |
Defined in Dhall.Util Methods showsPrec :: Int -> CheckFailed -> ShowS show :: CheckFailed -> String showList :: [CheckFailed] -> ShowS | |
Exception CheckFailed Source # | |
Defined in Dhall.Util Methods toException :: CheckFailed -> SomeException fromException :: SomeException -> Maybe CheckFailed displayException :: CheckFailed -> String |