hpack 0.29.6 → 0.29.7
raw patch · 6 files changed
+18/−10 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Hpack.Yaml: (.:) :: FromValue a => Object -> Text -> Parser a
+ Hpack.Yaml: (.:?) :: FromValue a => Object -> Text -> Parser (Maybe a)
+ Hpack.Yaml: Array :: !Array -> Value
+ Hpack.Yaml: Bool :: !Bool -> Value
+ Hpack.Yaml: Null :: Value
+ Hpack.Yaml: Number :: !Scientific -> Value
+ Hpack.Yaml: Object :: !Object -> Value
+ Hpack.Yaml: Options :: String -> String -> Options
+ Hpack.Yaml: String :: !Text -> Value
+ Hpack.Yaml: [optionsRecordSelectorModifier] :: Options -> String -> String
+ Hpack.Yaml: class FromValue a
+ Hpack.Yaml: class Generic a
+ Hpack.Yaml: class GenericDecode f
+ Hpack.Yaml: data Options
+ Hpack.Yaml: data Parser a
+ Hpack.Yaml: data Value
+ Hpack.Yaml: decodeValue :: FromValue a => Value -> Result a
+ Hpack.Yaml: fromValue :: forall d m. (FromValue a, Generic a, Rep a ~ D1 d m, Datatype d, GenericDecode (Rep a)) => Value -> Parser a
+ Hpack.Yaml: genericFromValue :: forall a d m. (Generic a, Rep a ~ D1 d m, Datatype d, GenericDecode (Rep a)) => Value -> Parser a
+ Hpack.Yaml: genericFromValueWith :: (Generic a, GenericDecode (Rep a)) => Options -> Value -> Parser a
+ Hpack.Yaml: parseArray :: (Value -> Parser a) -> Array -> Parser [a]
+ Hpack.Yaml: type Array = Vector Value
+ Hpack.Yaml: type Object = HashMap Text Value
+ Hpack.Yaml: type Result a = Either String (a, [String])
+ Hpack.Yaml: typeMismatch :: String -> Value -> Parser a
+ Hpack.Yaml: withArray :: (Array -> Parser a) -> Value -> Parser a
+ Hpack.Yaml: withBool :: (Bool -> Parser a) -> Value -> Parser a
+ Hpack.Yaml: withNumber :: (Scientific -> Parser a) -> Value -> Parser a
+ Hpack.Yaml: withObject :: (Object -> Parser a) -> Value -> Parser a
+ Hpack.Yaml: withString :: (String -> Parser a) -> Value -> Parser a
+ Hpack.Yaml: withText :: (Text -> Parser a) -> Value -> Parser a
Files
- CHANGELOG.md +3/−0
- hpack.cabal +3/−3
- src/Data/Aeson/Config/FromValue.hs +9/−4
- src/Hpack/Yaml.hs +2/−0
- test/EndToEndSpec.hs +1/−1
- test/Hpack/Syntax/DependencySpec.hs +0/−2
CHANGELOG.md view
@@ -1,3 +1,6 @@+## Changes in 0.29.7+ - Expose more stuff from `Hpack.Yaml` so that it can be used by third parties+ ## Changes in 0.29.6 - Add `spec-version` (see #300)
hpack.cabal view
@@ -1,13 +1,13 @@ cabal-version: >= 1.10 --- This file has been generated from package.yaml by hpack version 0.29.5.+-- This file has been generated from package.yaml by hpack version 0.29.6. -- -- see: https://github.com/sol/hpack ----- hash: d8b2a418f831494685f8d946c109f4cf86371e5f1a41613bdd538aa6ed27817c+-- hash: 8d1eb0679326dc7c31be647812822700dc8277a27737239f5a704e45f367abdf name: hpack-version: 0.29.6+version: 0.29.7 synopsis: A modern format for Haskell packages description: See README at <https://github.com/sol/hpack#readme> category: Development
src/Data/Aeson/Config/FromValue.hs view
@@ -28,6 +28,8 @@ , withNumber , withBool +, parseArray+ , (.:) , (.:?) @@ -90,10 +92,13 @@ fromValue value = liftParser (parseJSON value) >>= traverse fromValue instance FromValue a => FromValue [a] where- fromValue = withArray $ zipWithM (parseIndexed fromValue) [0..] . V.toList- where- parseIndexed :: (Value -> Parser a) -> Int -> Value -> Parser a- parseIndexed p n value = p value <?> Index n+ fromValue = withArray (parseArray fromValue)++parseArray :: (Value -> Parser a) -> Array -> Parser [a]+parseArray f = zipWithM (parseIndexed f) [0..] . V.toList+ where+ parseIndexed :: (Value -> Parser a) -> Int -> Value -> Parser a+ parseIndexed p n value = p value <?> Index n instance FromValue a => FromValue (Map String a) where fromValue = withObject $ \ o -> do
src/Hpack/Yaml.hs view
@@ -13,10 +13,12 @@ -- tool that supports Hpack (e.g. @stack@ or @cabal2nix@). decodeYaml+, module Data.Aeson.Config.FromValue ) where import Data.Yaml hiding (decodeFile, decodeFileEither) import Data.Yaml.Include+import Data.Aeson.Config.FromValue decodeYaml :: FilePath -> IO (Either String Value) decodeYaml file = do
test/EndToEndSpec.hs view
@@ -1450,7 +1450,7 @@ content = [i| executable #{name} other-modules:- Paths_#{name}+ Paths_foo #{indentBy 2 $ unindent e} default-language: Haskell2010 |]
test/Hpack/Syntax/DependencySpec.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedLists #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ConstraintKinds #-} module Hpack.Syntax.DependencySpec (spec) where import Helper