packages feed

bitwise-enum 1.0.0.2 → 1.0.0.3

raw patch · 5 files changed

+18/−20 lines, 5 filesdep ~aesondep ~arraydep ~deepseqPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, array, deepseq, mono-traversable, vector

API changes (from Hackage documentation)

Files

Data/Enum/Memo.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE ExplicitForAll      #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE UnicodeSyntax       #-}
 {-# LANGUAGE TypeApplications    #-}
Data/Enum/Set.hs view
@@ -48,7 +48,7 @@ --
 -- For type @EnumSet E@, @EnumSetRep E@ should be a @Word@-like type that
 -- implements 'Bits' and 'Num', and @E@ should be a type that implements 'Eq'
--- and 'Enum' equivalently and is a bijection to 'Int'.
+-- and 'Enum' equivalently and is a bijection to 'Int' over its range.
 -- @EnumSet E@ can only store a value of @E@ if the result of applying
 -- 'fromEnum' to the value is positive and less than the number of bits in
 -- @EnumSetRep E@. For this reason, it is preferable for @E@ to be a type that
@@ -200,7 +200,7 @@ {-# INLINE size #-}
 
 -- | /O(1)/. Is this a subset?
--- @(s1 `isSubsetOf` s2)@ tells whether @s1@ is a subset of @s2@.
+-- @(s1 \`isSubsetOf\` s2)@ tells whether @s1@ is a subset of @s2@.
 isSubsetOf :: ∀ a. AsEnumSet a => EnumSet a -> EnumSet a -> Bool
 isSubsetOf = E.isSubsetOf
 {-# INLINE isSubsetOf #-}
Data/Enum/Set/Base.hs view
@@ -2,7 +2,6 @@ {-# LANGUAGE BlockArguments             #-}
 {-# LANGUAGE DataKinds                  #-}
 {-# LANGUAGE DeriveDataTypeable         #-}
-{-# LANGUAGE ExplicitForAll             #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE PolyKinds                  #-}
@@ -40,7 +39,7 @@ --
 -- For type @EnumSet W E@, @W@ should be a 'Word'-like type that implements
 -- 'Bits' and 'Num', and @E@ should be a type that implements 'Eq' and 'Enum'
--- equivalently and is a bijection to 'Int'.
+-- equivalently and is a bijection to 'Int' over its range.
 -- @EnumSet W E@ can only store a value of @E@ if the result of applying
 -- 'fromEnum' to the value is positive and less than the number of bits in @W@.
 -- For this reason, it is preferable for @E@ to be a type that derives 'Eq' and
@@ -129,7 +128,6 @@ 
 import Control.Applicative (liftA2)
 import Control.DeepSeq (NFData)
-import Control.Monad
 import Data.Aeson (ToJSON(..))
 import Data.Bits
 import Data.Data (Data)
@@ -166,11 +164,11 @@     {-# INLINE basicUnsafeSlice #-}
     basicOverlaps (MV_EnumSet v1) (MV_EnumSet v2) = M.basicOverlaps v1 v2
     {-# INLINE basicOverlaps #-}
-    basicUnsafeNew n = MV_EnumSet `liftM` M.basicUnsafeNew n
+    basicUnsafeNew n = MV_EnumSet <$> M.basicUnsafeNew n
     {-# INLINE basicUnsafeNew #-}
     basicInitialize (MV_EnumSet v) = M.basicInitialize v
     {-# INLINE basicInitialize #-}
-    basicUnsafeReplicate n x = MV_EnumSet `liftM` M.basicUnsafeReplicate n x
+    basicUnsafeReplicate n x = MV_EnumSet <$> M.basicUnsafeReplicate n x
     {-# INLINE basicUnsafeReplicate #-}
     basicUnsafeRead (MV_EnumSet v) i = M.basicUnsafeRead v i
     {-# INLINE basicUnsafeRead #-}
@@ -184,14 +182,14 @@     {-# INLINE basicUnsafeCopy #-}
     basicUnsafeMove (MV_EnumSet v1) (MV_EnumSet v2) = M.basicUnsafeMove v1 v2
     {-# INLINE basicUnsafeMove #-}
-    basicUnsafeGrow (MV_EnumSet v) n = MV_EnumSet `liftM` M.basicUnsafeGrow v n
+    basicUnsafeGrow (MV_EnumSet v) n = MV_EnumSet <$> M.basicUnsafeGrow v n
     {-# INLINE basicUnsafeGrow #-}
 
 
 instance P.Prim word => G.Vector Vector (EnumSet word a) where
-    basicUnsafeFreeze (MV_EnumSet v) = V_EnumSet `liftM` G.basicUnsafeFreeze v
+    basicUnsafeFreeze (MV_EnumSet v) = V_EnumSet <$> G.basicUnsafeFreeze v
     {-# INLINE basicUnsafeFreeze #-}
-    basicUnsafeThaw (V_EnumSet v) = MV_EnumSet `liftM` G.basicUnsafeThaw v
+    basicUnsafeThaw (V_EnumSet v) = MV_EnumSet <$> G.basicUnsafeThaw v
     {-# INLINE basicUnsafeThaw #-}
     basicLength (V_EnumSet v) = G.basicLength v
     {-# INLINE basicLength #-}
@@ -380,7 +378,7 @@ size (EnumSet !w) = popCount w
 
 -- | /O(1)/. Is this a subset?
--- @(s1 `isSubsetOf` s2)@ tells whether @s1@ is a subset of @s2@.
+-- @(s1 \`isSubsetOf\` s2)@ tells whether @s1@ is a subset of @s2@.
 isSubsetOf :: ∀ w a. (Bits w)
            => EnumSet w a -> EnumSet w a -> Bool
 isSubsetOf (EnumSet x) (EnumSet y) = x .|. y == y
@@ -633,7 +631,8 @@ msb w = finiteBitSize w - 1 - countLeadingZeros w
 {-# INLINE msb #-}
 
--- These folding algorithms are similar to those of [IntSet](https://hackage.haskell.org/package/containers-0.6.0.1/docs/src/Data.IntSet.Internal.html), but generalized to work with any FiniteBits type.
+-- These folding algorithms are similar to those of [IntSet](https://hackage.haskell.org/package/containers-0.6.0.1/docs/src/Data.IntSet.Internal.html),
+-- but generalized to work with any FiniteBits type.
 
 -- | Left fold over bits.
 foldlBits :: ∀ w a. (FiniteBits w, Num w) => (a -> Int -> a) -> a -> w -> a
benchmarks/EnumSet.hs view
@@ -30,9 +30,9 @@ 
 benchWord :: ∀ w. (FiniteBits w, NFData w, Num w, Typeable w) => IO [Benchmark]
 benchWord = do
-    let s = E.fromFoldable elems :: E.EnumSet w Int
+    let s      = E.fromFoldable elems      :: E.EnumSet w Int
         s_even = E.fromFoldable elems_even :: E.EnumSet w Int
-        s_odd = E.fromFoldable elems_odd :: E.EnumSet w Int
+        s_odd  = E.fromFoldable elems_odd  :: E.EnumSet w Int
     evaluate $ rnf [s, s_even, s_odd]
     return
       [ bench "singleton" (E.singleton :: Int -> E.EnumSet w Int) 2
bitwise-enum.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 9237fd9d9cd252842f0b67b2fd19ebd650593bdbba3be2567dee83b5ff6288f2+-- hash: ee84edf13441f046fa34c363bde7afdf23d3bef8aabe9a215ae4f296f4844976  name:           bitwise-enum-version:        1.0.0.2+version:        1.0.0.3 synopsis:       Bitwise operations on bounded enumerations description:    Bitwise operations on bounded enumerations.                 .@@ -38,7 +38,7 @@       ./   ghc-options: -Wall -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-record-updates -ferror-spans -funbox-small-strict-fields -O2   build-depends:-      aeson >=0.11 && <1.5.5+      aeson >=0.11 && <1.5.6     , array >=0.5.1 && <0.5.5     , base >=4.5 && <5     , deepseq >=1.1 && <1.4.5@@ -56,7 +56,7 @@   ghc-options: -Wall -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-record-updates -ferror-spans -funbox-small-strict-fields   build-depends:       QuickCheck >=2.13.2-    , aeson >=0.11 && <1.5.5+    , aeson >=0.11 && <1.5.6     , array >=0.5.1 && <0.5.5     , base     , bitwise-enum@@ -76,7 +76,7 @@       benchmarks   ghc-options: -Wall -Wcompat -Widentities -Wincomplete-uni-patterns -Wincomplete-record-updates -ferror-spans -funbox-small-strict-fields -rtsopts -threaded -with-rtsopts=-N -O2   build-depends:-      aeson >=0.11 && <1.5.5+      aeson >=0.11 && <1.5.6     , array >=0.5.1 && <0.5.5     , base     , bitwise-enum