Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data Transitivity
- data OutputMode
- data Output
- getExpression :: Censor -> Input -> IO (Expr Src Import)
- getExpressionAndHeader :: Censor -> Input -> IO (Header, Expr Src Import)
- getExpressionAndHeaderFromStdinText :: Censor -> String -> Text -> IO (Header, Expr Src Import)
- newtype Header = Header Text
- newtype CheckFailed = CheckFailed {}
- data MultipleCheckFailed = MultipleCheckFailed {}
- handleMultipleChecksFailed :: (Foldable t, Traversable t) => Text -> Text -> (a -> IO (Either CheckFailed ())) -> t a -> IO ()
- renderExpression :: Pretty a => CharacterSet -> Bool -> Maybe FilePath -> Expr Src a -> IO ()
Documentation
Set to Censor
if you want to censor error text that might include secrets
Path to input
data Transitivity Source #
Specifies whether or not an input's transitive dependencies should also be processed. Transitive dependencies are restricted to relative file imports.
NonTransitive | Do not process transitive dependencies |
Transitive | Process transitive dependencies in the same way |
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 -> String -> 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
newtype CheckFailed Source #
A check failure corresponding to a single input.
This type is intended to be used with MultipleCheckFailed
for error
reporting.
data MultipleCheckFailed Source #
Exception thrown when the --check
flag to a command-line subcommand fails
Instances
Show MultipleCheckFailed Source # | |
Defined in Dhall.Util showsPrec :: Int -> MultipleCheckFailed -> ShowS # show :: MultipleCheckFailed -> String # showList :: [MultipleCheckFailed] -> ShowS # | |
Exception MultipleCheckFailed Source # | |
Defined in Dhall.Util |
handleMultipleChecksFailed :: (Foldable t, Traversable t) => Text -> Text -> (a -> IO (Either CheckFailed ())) -> t a -> IO () Source #
Run IO for multiple inputs, then collate all the check failures before throwing if there was any failure