Permalink
Browse files

Add missing 'NFData' instances

Starting with `containers-0.5`, the container types come equipped
with `NFData` instances, and so should `enummapset`...
  • Loading branch information...
1 parent c1a6fe6 commit 51a72f15b2ced7b5236278998186aa6b914041ea @hvr hvr committed Oct 1, 2012
Showing with 6 additions and 3 deletions.
  1. +2 −1 Data/EnumMap.hs
  2. +2 −1 Data/EnumSet.hs
  3. +2 −1 enummapset.cabal
View
@@ -154,6 +154,7 @@ import Data.EnumSet ( EnumSet )
import qualified Data.EnumSet as EnumSet
import Control.Arrow ( first, second, (***) )
+import Control.DeepSeq ( NFData )
import Data.Foldable ( Foldable )
import Data.Monoid ( Monoid )
import Data.Traversable ( Traversable )
@@ -163,7 +164,7 @@ import Text.Read
-- | Wrapper for 'IntMap' with 'Enum' keys.
newtype EnumMap k a = EnumMap { unWrap :: IntMap a }
- deriving (Eq, Foldable, Functor, Ord, Monoid, Traversable, Typeable)
+ deriving (Eq, Foldable, Functor, Ord, Monoid, Traversable, Typeable, NFData)
instance (Enum k, Show k, Show a) => Show (EnumMap k a) where
showsPrec p em = showParen (p > 10) $
View
@@ -86,14 +86,15 @@ import qualified Prelude as P
import Data.IntSet ( IntSet )
import qualified Data.IntSet as I
+import Control.DeepSeq ( NFData )
import Data.Monoid ( Monoid )
import Data.Typeable ( Typeable )
import Text.Read
-- | Wrapper for 'IntSet' with 'Enum' elements.
newtype EnumSet e = EnumSet { unWrap :: IntSet }
- deriving (Eq, Monoid, Ord, Typeable)
+ deriving (Eq, Monoid, Ord, Typeable, NFData)
instance (Enum e, Show e) => Show (EnumSet e) where
showsPrec p es = showParen (p > 10) $
View
@@ -28,6 +28,7 @@ Library
build-depends:
base < 5,
- containers >= 0.5 && < 0.6
+ containers >= 0.5 && < 0.6,
+ deepseq >= 1.2 && < 1.4
ghc-options: -Wall

0 comments on commit 51a72f1

Please sign in to comment.