diff --git a/src/Hpack/Yaml.hs b/src/Hpack/Yaml.hs index 0be1eca7..4f7047a3 100644 --- a/src/Hpack/Yaml.hs +++ b/src/Hpack/Yaml.hs @@ -14,7 +14,7 @@ module Hpack.Yaml ( -- tool that supports Hpack (e.g. @stack@ or @cabal2nix@). decodeYaml -, decodeYamlWithParseException +, decodeYamlWithParseError , ParseException , formatYamlParseError , formatWarning @@ -30,10 +30,10 @@ import Data.Aeson.Config.FromValue import Data.Aeson.Config.Parser (fromAesonPath, formatPath) decodeYaml :: FilePath -> IO (Either String ([String], Value)) -decodeYaml file = first (formatYamlParseError file) <$> decodeYamlWithParseException file +decodeYaml file = first (formatYamlParseError file) <$> decodeYamlWithParseError file -decodeYamlWithParseException :: FilePath -> IO (Either ParseException ([String], Value)) -decodeYamlWithParseException file = do +decodeYamlWithParseError :: FilePath -> IO (Either ParseException ([String], Value)) +decodeYamlWithParseError file = do result <- decodeFileWithWarnings file return $ fmap (first (map $ formatWarning file)) result