enumset 0.0 → 0.0.1
raw patch · 2 files changed
+17/−5 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Data.EnumSet: null :: (Enum a, Bits w) => T w a -> Bool
Files
- enumset.cabal +12/−4
- src/Data/EnumSet.hs +5/−1
enumset.cabal view
@@ -1,10 +1,9 @@ Name: enumset-Version: 0.0+Version: 0.0.1 License: BSD3 License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de> Maintainer: Henning Thielemann <haskell@henning-thielemann.de>-Homepage: http://code.haskell.org/~thielema/enumset/ Category: Data, Foreign Synopsis: Sets of enumeration values represented by machine words Description:@@ -20,14 +19,23 @@ however our implementation allows you to choose the embedding type and thus the maximum size of the set. -- Portability: Haskell98-Cabal-Version: >=1.2+Cabal-Version: >=1.6 Tested-With: GHC==6.10.4, GHC==6.12.3 Build-Type: Simple +Source-Repository this+ Tag: 0.0.1+ Type: darcs+ Location: http://code.haskell.org/~thielema/enumset/++Source-Repository head+ Type: darcs+ Location: http://code.haskell.org/~thielema/enumset/+ Library Build-Depends: storable-record >=0.0.1 && <0.1,- base >= 4 && <6+ base >= 4 && <5 GHC-Options: -Wall Hs-Source-Dirs: src
src/Data/EnumSet.hs view
@@ -9,6 +9,7 @@ fromEnums, toEnums, intToEnums,+ null, empty, (.&.), (.|.),@@ -29,7 +30,7 @@ import Foreign.Storable (Storable(..), ) import qualified Prelude as P-import Prelude hiding (fromEnum, toEnum, flip, )+import Prelude hiding (fromEnum, toEnum, null, flip, ) newtype T word enum = Cons {decons :: word}@@ -60,6 +61,9 @@ zip [P.toEnum 0 ..] . iterate (P.flip div 2) . decons ++null :: (Enum a, Bits w) => T w a -> Bool+null (Cons x) = x==0 empty :: (Enum a, Bits w) => T w a empty = Cons 0