git.iko.soy/monoidal-containers
on master help sign in
Support unordered-containers prior to 0.2.8
commit2fcfd6e3a32ae70e42e58a81be53a37b4ac114f4 authorElliot Cameron <eacameron@gmail.com> dateThu 30 Aug 2018, 17:05 (8 years ago) parent38b2aca
1 file changed+8−3
src/Data/HashMap/Monoidal.hs+8−3
src/Data/HashMap/Monoidal.hs+8−3
@@ -53,15 +53,20 @@ import qualified GHC.Exts as Exts
5353import Control.DeepSeq
5454import qualified Data.HashMap.Strict as M
5555import Data.Hashable (Hashable)
56+#if MIN_VERSION_unordered_containers(0,2,8)
5657import Data.Hashable.Lifted (Hashable1)
58+#endif
5759import Control.Lens
5860import Control.Newtype
5961
6062-- | A 'HashMap' with monoidal accumulation
6163newtype MonoidalHashMap k a = MonoidalHashMap { getMonoidalHashMap :: M.HashMap k a }
62− deriving (Show, Read, Functor, Eq, NFData,
63− Foldable, Traversable,
64− Data, Typeable, Hashable1, Hashable)
64+ deriving ( Show, Read, Functor, Eq, NFData
65+ , Foldable, Traversable, Data, Typeable, Hashable
66+#if MIN_VERSION_unordered_containers(0,2,8)
67+ , Hashable1
68+#endif
69+ )
6570
6671type instance Index (MonoidalHashMap k a) = k
6772type instance IxValue (MonoidalHashMap k a) = a