packages feed

data-diverse 1.2.0.0 → 1.2.0.1

raw patch · 5 files changed

+20/−3 lines, 5 filesdep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: containers

API changes (from Hackage documentation)

- Data.Diverse.Many: insertAfter :: forall x y xs proxy. (UniqueMember x xs) => proxy x -> y -> Many xs -> Many (Append (To x xs) (y : After x xs))
- Data.Diverse.Many: insertAfterL :: forall l y xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> y -> Many xs -> Many (Append (To x xs) (y : After x xs))
- Data.Diverse.Many: insertAfterN :: forall n y xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> y -> Many xs -> Many (Append (ToIndex n xs) (y : AfterIndex n xs))
- Data.Diverse.Many: insertBefore :: forall x y xs proxy. (UniqueMember x xs) => proxy x -> y -> Many xs -> Many (Append (Before x xs) (y : From x xs))
- Data.Diverse.Many: insertBeforeL :: forall l y xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> y -> Many xs -> Many (Append (Before x xs) (y : From x xs))
- Data.Diverse.Many: insertBeforeN :: forall n y xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> y -> Many xs -> Many (Append (BeforeIndex n xs) (y : FromIndex n xs))
- Data.Diverse.Many: remove :: forall x xs proxy. (UniqueMember x xs) => proxy x -> Many xs -> Many (Remove x xs)
- Data.Diverse.Many: removeL :: forall l xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> Many xs -> Many (Remove x xs)
- Data.Diverse.Many: removeN :: forall n xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> Many xs -> Many (RemoveIndex n xs)
- Data.Diverse.Many.Internal: insertAfter :: forall x y xs proxy. (UniqueMember x xs) => proxy x -> y -> Many xs -> Many (Append (To x xs) (y : After x xs))
- Data.Diverse.Many.Internal: insertAfterL :: forall l y xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> y -> Many xs -> Many (Append (To x xs) (y : After x xs))
- Data.Diverse.Many.Internal: insertAfterN :: forall n y xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> y -> Many xs -> Many (Append (ToIndex n xs) (y : AfterIndex n xs))
- Data.Diverse.Many.Internal: insertBefore :: forall x y xs proxy. (UniqueMember x xs) => proxy x -> y -> Many xs -> Many (Append (Before x xs) (y : From x xs))
- Data.Diverse.Many.Internal: insertBeforeL :: forall l y xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> y -> Many xs -> Many (Append (Before x xs) (y : From x xs))
- Data.Diverse.Many.Internal: insertBeforeN :: forall n y xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> y -> Many xs -> Many (Append (BeforeIndex n xs) (y : FromIndex n xs))
- Data.Diverse.Many.Internal: remove :: forall x xs proxy. (UniqueMember x xs) => proxy x -> Many xs -> Many (Remove x xs)
- Data.Diverse.Many.Internal: removeL :: forall l xs proxy x. (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => proxy l -> Many xs -> Many (Remove x xs)
- Data.Diverse.Many.Internal: removeN :: forall n xs proxy. (KnownNat n, (n + 1) <= Length xs) => proxy n -> Many xs -> Many (RemoveIndex n xs)

Files

README.md view
@@ -14,6 +14,9 @@  # Changelog +* 1.2.0.1+  - 'insert'/'remove' is not available in GHC 8.2 onwards.+ * 1.2.0.0   - Rerranged type variable for xxxL and xxxN functions so that the     @x@ inferrred from label @l@ or index @n@ is after @proxy@.
data-diverse.cabal view
@@ -1,5 +1,5 @@ name:                data-diverse-version:             1.2.0.0+version:             1.2.0.1 synopsis:            Extensible records and polymorphic variants. description:         "Data.Diverse.Many" is an extensible record for any size encoded efficiently as (Seq Any).                      "Data.Diverse.Which" is a polymorphic variant of possibilities encoded as (Int, Any).@@ -39,10 +39,13 @@                        Data.Diverse.Which                        Data.Diverse.Which.Internal   build-depends:       base >= 4.7 && < 5-                     , containers >= 0.5.8.2 && < 0.6                      , deepseq >= 1.4 && < 2                      , ghc-prim >= 0.5 && < 1                      , tagged >= 0.8.5 && < 1+  if impl(ghc >= 8.2.0)+    build-depends: containers >= 0.5.8.2 && < 0.6+  else+    build-depends: containers >= 0.5 && < 0.6   ghc-options:         -Wall   default-language:    Haskell2010 
src/Data/Diverse/Many.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | Re-export Many without the constructor module Data.Diverse.Many (     -- * 'Many' type@@ -90,6 +92,7 @@     , insetAfterL     , insetAfterN +#if __GLASGOW_HASKELL__ >= 802     -- * insert single item     , insertBefore     , insertBeforeL@@ -102,7 +105,7 @@     , remove     , removeL     , removeN-+#endif     ) where  import Data.Diverse.Many.Internal
src/Data/Diverse/Many/Internal.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}@@ -107,6 +108,7 @@     , insetAfterL     , insetAfterN +#if __GLASGOW_HASKELL__ >= 802     -- * insert single item     , insertBefore     , insertBeforeL@@ -119,6 +121,7 @@     , remove     , removeL     , removeN+#endif      ) where @@ -570,6 +573,7 @@     i = fromInteger (natVal @n Proxy) :: Int  --------------------------------------------------+#if __GLASGOW_HASKELL__ >= 802  -- | Insert an item into a Many, inserting after unique type @x@ insertAfter_@@ -670,6 +674,8 @@ removeN _ (Many xs) = Many (S.deleteAt i xs)   where     i = fromInteger (natVal @n Proxy) :: Int++#endif  -------------------------------------------------- 
test/Data/Diverse/ManySpec.hs view
@@ -391,6 +391,7 @@             insetAfterL (Proxy @Dee) z y `shouldBe` y2a /./ z /./ y2b             insetAfterN (Proxy @2) z x `shouldBe` x2a /./ z /./ x2b +#if __GLASGOW_HASKELL__ >= 802         it "can be 'insert'ted with an item at a specific place" $ do             let x = (5 :: Int) ./ False ./ 'X' ./ Just True ./ Just 'A' ./ nil                 y = (Tagged 5 :: Tagged Foo Int) ./ False ./ Tagged @Dee 'X' ./ Just True ./ Tagged @Bar (Just 'A') ./ nil@@ -443,3 +444,4 @@             remove (Proxy @(Char)) x `shouldBe` x'             removeL (Proxy @Dee) y `shouldBe` y'             removeN (Proxy @2) x `shouldBe` x'+#endif