packages feed

tomland 1.3.3.2 → 1.3.3.3

raw patch · 11 files changed

+96/−37 lines, 11 filesdep −transformersdep ~basedep ~containersdep ~hashablenew-uploader

Dependencies removed: transformers

Dependency ranges changed: base, containers, hashable, hedgehog, hspec-hedgehog, megaparsec, time

Files

CHANGELOG.md view
@@ -3,6 +3,12 @@ `tomland` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 1.3.3.3 – Jun 7, 2024++* Support up to GHC-9.10.+* Remove `transformers` dependency.+* Allow test case to work with `OverloadedStrings`+ ## 1.3.3.2 – Oct 5, 2022  * [#395](https://github.com/kowainik/tomland/issues/395):
README.lhs view
@@ -3,10 +3,7 @@ ![palm](https://user-images.githubusercontent.com/4276606/51088259-7a777000-176e-11e9-9d76-6be4023c0ac3.png)  [![GitHub CI](https://github.com/kowainik/tomland/workflows/CI/badge.svg)](https://github.com/kowainik/tomland/actions)-[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/github/kowainik/tomland?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/tomland) [![Hackage](https://img.shields.io/hackage/v/tomland.svg?logo=haskell)](https://hackage.haskell.org/package/tomland)-[![Stackage LTS](http://stackage.org/package/tomland/badge/lts)](http://stackage.org/lts/package/tomland)-[![Stackage Nightly](http://stackage.org/package/tomland/badge/nightly)](http://stackage.org/nightly/package/tomland) [![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/tomland/blob/main/LICENSE)  > “A library is like an island in the middle of a vast sea of ignorance,
README.md view
@@ -3,10 +3,7 @@ ![palm](https://user-images.githubusercontent.com/4276606/51088259-7a777000-176e-11e9-9d76-6be4023c0ac3.png)  [![GitHub CI](https://github.com/kowainik/tomland/workflows/CI/badge.svg)](https://github.com/kowainik/tomland/actions)-[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/github/kowainik/tomland?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/tomland) [![Hackage](https://img.shields.io/hackage/v/tomland.svg?logo=haskell)](https://hackage.haskell.org/package/tomland)-[![Stackage LTS](http://stackage.org/package/tomland/badge/lts)](http://stackage.org/lts/package/tomland)-[![Stackage Nightly](http://stackage.org/package/tomland/badge/nightly)](http://stackage.org/nightly/package/tomland) [![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/tomland/blob/main/LICENSE)  > “A library is like an island in the middle of a vast sea of ignorance,
src/Toml/Codec/BiMap/Conversion.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP   #-} {-# LANGUAGE GADTs #-}  {- |@@ -427,7 +428,14 @@  @since 0.5.0 -}-_HashSet :: (Eq a, Hashable a) => TomlBiMap a AnyValue -> TomlBiMap (HS.HashSet a) AnyValue+_HashSet+#if MIN_VERSION_hashable(1,4,0)+  :: (Hashable a)+#else+  :: (Eq a, Hashable a)+#endif+  => TomlBiMap a AnyValue+  -> TomlBiMap (HS.HashSet a) AnyValue _HashSet bi = iso HS.toList HS.fromList >>> _Array bi {-# INLINE _HashSet #-} @@ -624,7 +632,7 @@ _Left :: (Show l, Show r) => TomlBiMap (Either l r) l _Left = prism Left $ \case     Left l -> Right l-    x -> wrongConstructor "Left" x+    x      -> wrongConstructor "Left" x  {- | 'BiMap' for 'Either' and its 'Right' part. @@ -633,7 +641,7 @@ _Right :: (Show l, Show r) => TomlBiMap (Either l r) r _Right = prism Right $ \case     Right r -> Right r-    x -> wrongConstructor "Right" x+    x       -> wrongConstructor "Right" x  {- | 'BiMap' for 'Maybe' and its 'Just' part. @@ -642,4 +650,4 @@ _Just :: Show r => TomlBiMap (Maybe r) r _Just = prism Just $ \case     Just r -> Right r-    x -> wrongConstructor "Just" x+    x      -> wrongConstructor "Just" x
src/Toml/Codec/Combinator/Map.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE ApplicativeDo   #-}+{-# LANGUAGE CPP             #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TupleSections   #-} @@ -74,8 +75,8 @@ import Control.Applicative (empty) import Control.Monad (forM_) import Control.Monad.State (gets, modify)-import Data.Hashable (Hashable) import Data.HashMap.Strict (HashMap)+import Data.Hashable (Hashable) import Data.IntMap.Strict (IntMap) import Data.List.NonEmpty (NonEmpty (..)) import Data.Map.Strict (Map)@@ -87,7 +88,7 @@ import Toml.Codec.Code (execTomlCodec) import Toml.Codec.Combinator.Common (whenLeftBiMapError) import Toml.Codec.Types (Codec (..), TomlCodec, TomlEnv, TomlState (..))-import Toml.Type.Key (pattern (:||), Key)+import Toml.Type.Key (Key, pattern (:||)) import Toml.Type.TOML (TOML (..), insertTable, insertTableArrays)  import qualified Data.HashMap.Strict as HashMap@@ -237,7 +238,11 @@ -} hashMap     :: forall k v+#if MIN_VERSION_hashable(1,4,0)+    .  (Hashable k)+#else     .  (Eq k, Hashable k)+#endif     => TomlCodec k  -- ^ Codec for 'HashMap' keys     -> TomlCodec v  -- ^ Codec for 'HashMap' values     -> Key          -- ^ TOML key where 'HashMap' is stored@@ -261,7 +266,11 @@ -} tableHashMap     :: forall k v+#if MIN_VERSION_hashable(1,4,0)+    .  (Hashable k)+#else     .  (Eq k, Hashable k)+#endif     => TomlBiMap Key k     -- ^ Bidirectional converter between TOML 'Key's and 'HashMap' keys     -> (Key -> TomlCodec v)
src/Toml/Codec/Combinator/Set.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ {- | Module                  : Toml.Codec.Combinator.Set Copyright               : (c) 2018-2022 Kowainik@@ -152,7 +154,11 @@ @since 0.5.0 -} arrayHashSetOf-    :: (Hashable a, Eq a)+#if MIN_VERSION_hashable(1,4,0)+  :: (Hashable a)+#else+  :: (Eq a, Hashable a)+#endif     => TomlBiMap a AnyValue     -> Key     -> TomlCodec (HashSet a)@@ -222,6 +228,15 @@  @since 1.2.0.0 -}-hashSet :: forall a . (Hashable a, Eq a) => TomlCodec a -> Key -> TomlCodec (HashSet a)+hashSet +    :: forall a +#if MIN_VERSION_hashable(1,4,0)+    .  (Hashable a)+#else+    .  (Eq a, Hashable a)+#endif+    => TomlCodec a +    -> Key +    -> TomlCodec (HashSet a) hashSet codec key = dimap HS.toList HS.fromList (list codec key) {-# INLINE hashSet #-}
src/Toml/Codec/Generic.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes  #-}+{-# LANGUAGE CPP                  #-} {-# LANGUAGE DataKinds            #-} {-# LANGUAGE FlexibleContexts     #-} {-# LANGUAGE FlexibleInstances    #-}@@ -586,7 +587,12 @@     {-# INLINE hasCodec #-}  -- | @since 1.2.0.0-instance (Hashable a, Eq a, HasItemCodec a) => HasCodec (HashSet a) where+#if MIN_VERSION_hashable(1,4,0)+instance (Hashable a, HasItemCodec a)+#else+instance (Hashable a, Eq a, HasItemCodec a)+#endif+  => HasCodec (HashSet a) where     hasCodec = case hasItemCodec @a of         Left prim   -> Toml.arrayHashSetOf prim         Right codec -> Toml.hashSet codec@@ -624,7 +630,12 @@  @since 1.3.0.0 -}-instance (Hashable k, Eq k, HasCodec k, HasCodec v) => HasCodec (HashMap k v) where+#if MIN_VERSION_hashable(1,4,0)+instance (Hashable k, HasCodec k, HasCodec v)+#else+instance (Hashable k, Eq k, HasCodec k, HasCodec v)+#endif+  => HasCodec (HashMap k v) where     hasCodec = Toml.hashMap (hasCodec @k "key") (hasCodec @v "val")     {-# INLINE hasCodec #-} 
src/Toml/Codec/Types.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TupleSections         #-} {-# LANGUAGE TypeFamilies          #-}+{-# LANGUAGE TypeOperators         #-} {-# LANGUAGE UndecidableInstances  #-}  {- |
test/Test/Toml/Gen.hs view
@@ -1,5 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE CPP                 #-} {-# LANGUAGE DataKinds           #-} {-# LANGUAGE MultiWayIf          #-} {-# LANGUAGE PatternSynonyms     #-}@@ -113,7 +114,7 @@     bare = liftA2 Text.cons Gen.alpha $ Gen.text (Range.constant 1 10) alphadashes      alphadashes :: Gen Char-    alphadashes = Gen.choice [Gen.alphaNum, Gen.element "_-"]+    alphadashes = Gen.choice [Gen.alphaNum, Gen.element ("_-" :: [Char])]      quoted :: Gen Text     quoted = genNotEscape $ Gen.choice@@ -258,7 +259,14 @@ genSet :: Ord a => Gen a -> Gen (Set a) genSet genA = fromList <$> genList genA -genHashSet :: (Eq a, Hashable a) => Gen a -> Gen (HashSet a)+genHashSet +#if MIN_VERSION_hashable(1,4,0)+    :: (Hashable a)+#else+    :: (Eq a, Hashable a) +#endif+    => Gen a +    -> Gen (HashSet a) genHashSet genA = fromList <$> genList genA  genNonEmpty :: Gen a -> Gen (NonEmpty a)@@ -387,7 +395,7 @@  -- filters --- | Discards strings that end with \+-- | Discards strings that end with @\@ genNotEscape :: Gen Text -> Gen Text genNotEscape gen = gen >>= \t ->     if | Text.null t -> pure t
test/Test/Toml/Parser/Common.hs view
@@ -41,7 +41,10 @@                   minutesToTimeZone) import Test.Hspec (Expectation) import Test.Hspec.Megaparsec (shouldFailOn, shouldParse)-import Text.Megaparsec (Parsec, ShowErrorComponent, Stream, parse)+import Text.Megaparsec (Parsec, ShowErrorComponent, parse)+#if __GLASGOW_HASKELL__ <= 804+import Text.Megaparsec (Stream)+#endif #if MIN_VERSION_megaparsec(9,0,0) import Text.Megaparsec.Stream (TraversableStream, VisualStream) #endif@@ -58,7 +61,9 @@  parseX     :: ( ShowErrorComponent e+#if __GLASGOW_HASKELL__ <= 804        , Stream s+#endif #if MIN_VERSION_megaparsec(9,0,0)        , VisualStream s        , TraversableStream s
tomland.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                tomland-version:             1.3.3.2+version:             1.3.3.3 synopsis:            Bidirectional TOML serialization description:     Implementation of bidirectional TOML serialization. Simple codecs look like this:@@ -27,7 +27,7 @@ license-file:        LICENSE author:              Dmitrii Kovanikov, Veronika Romashkina maintainer:          Kowainik <xrom.xkov@gmail.com>-copyright:           2018-2022 Kowainik+copyright:           2018-2023 Kowainik category:            TOML, Text, Configuration build-type:          Simple extra-doc-files:     README.md@@ -39,7 +39,10 @@                      GHC == 8.8.4                      GHC == 8.10.7                      GHC == 9.0.2-                     GHC == 9.2.4+                     GHC == 9.2.7+                     GHC == 9.4.4+                     GHC == 9.6.3+                     GHC == 9.8.1  source-repository head   type:                git@@ -56,7 +59,7 @@   manual:              True  common common-options-  build-depends:       base >= 4.11 && < 4.17+  build-depends:       base >= 4.11 && < 4.21    ghc-options:         -Wall                        -Wcompat@@ -130,18 +133,17 @@                            Toml.Type.UValue                            Toml.Type.Value -  build-depends:       bytestring >= 0.10 && < 0.12-                     , containers >= 0.5.7 && < 0.7-                     , deepseq ^>= 1.4+  build-depends:       bytestring >= 0.10 && < 0.13+                     , containers >= 0.5.7 && < 0.8+                     , deepseq >= 1.4 && < 1.6                      , hashable >= 1.3.1.0 && < 1.5-                     , megaparsec >= 7.0.5 && < 9.3-                     , mtl ^>= 2.2+                     , megaparsec >= 7.0.5 && < 9.7+                     , mtl >= 2.2 && < 2.4                      , parser-combinators >= 1.1.0 && < 1.4-                     , text >= 1.2 && < 2.1-                     , time >= 1.8 && < 1.14-                     , transformers >= 0.5 && < 0.7+                     , text >= 1.2 && < 2.2+                     , time >= 1.8 && < 1.15                      , unordered-containers ^>= 0.2.7-                     , validation-selective ^>= 0.1.0+                     , validation-selective >= 0.1.0 && < 0.3  executable readme   import:              common-options@@ -224,11 +226,11 @@                        Test.Toml.Property    build-depends:       bytestring-                     , containers >= 0.5.7 && < 0.7+                     , containers >= 0.5.7 && < 0.8                      , hashable-                     , hedgehog >= 1.0.1 && < 1.3-                     , hspec >= 2.7.1 && < 2.11-                     , hspec-hedgehog ^>= 0.0.1+                     , hedgehog >= 1.0.1 && < 1.5+                     , hspec >= 2.7.1 && < 2.12+                     , hspec-hedgehog >= 0.0.1.1 && < 0.2                      , hspec-megaparsec >= 2.0.0 && < 2.3.0                      , megaparsec                      , directory ^>= 1.3