git.iko.soy/monoidal-containers
on master help sign in
Derive Semialign instance for 'these' 0.8.0 and up
commit07dde2520a4caa4c2fca0e9b25b9e57eccc11a88 author3noch <eacameron@gmail.com> dateWed 3 Apr 2019, 01:06 (8 years ago) parenta34c9fb
3 files changed+19−8
src/Data/HashMap/Monoidal.hs+3 src/Data/Map/Monoidal.hs+8−4 src/Data/Map/Monoidal/Strict.hs+8−4
src/Data/HashMap/Monoidal.hs+3
@@ -66,6 +66,9 @@ newtype MonoidalHashMap k a = MonoidalHashMap { getMonoidalHashMap :: M.HashMap
6666 , Foldable, Traversable, Data, Typeable, Hashable, Align
6767#if MIN_VERSION_unordered_containers(0,2,8)
6868 , Hashable1
69+#endif
70+#if MIN_VERSION_these(0,8,0)
71+ , Semialign
6972#endif
7073 )
7174
src/Data/Map/Monoidal.hs+8−4
@@ -154,10 +154,14 @@ import Data.Align
154154
155155-- | A 'Map' with monoidal accumulation
156156newtype MonoidalMap k a = MonoidalMap { getMonoidalMap :: M.Map k a }
157− deriving (Show, Read, Functor, Eq, Ord, NFData,
158− Foldable, Traversable,
159− FromJSON, ToJSON, FromJSON1, ToJSON1,
160− Data, Typeable, Align)
157+ deriving ( Show, Read, Functor, Eq, Ord, NFData
158+ , Foldable, Traversable
159+ , FromJSON, ToJSON, FromJSON1, ToJSON1
160+ , Data, Typeable, Align
161+#if MIN_VERSION_these(0,8,0)
162+ , Semialign
163+#endif
164+ )
161165
162166#if MIN_VERSION_containers(0,5,9)
163167deriving instance (Ord k) => Eq1 (MonoidalMap k)
src/Data/Map/Monoidal/Strict.hs+8−4
@@ -154,10 +154,14 @@ import Data.Align
154154
155155-- | A 'Map' with monoidal accumulation
156156newtype MonoidalMap k a = MonoidalMap { getMonoidalMap :: M.Map k a }
157− deriving (Show, Read, Functor, Eq, Ord, NFData,
158− Foldable, Traversable,
159− FromJSON, ToJSON, FromJSON1, ToJSON1,
160− Data, Typeable, Align)
157+ deriving ( Show, Read, Functor, Eq, Ord, NFData
158+ , Foldable, Traversable
159+ , FromJSON, ToJSON, FromJSON1, ToJSON1
160+ , Data, Typeable, Align
161+#if MIN_VERSION_these(0,8,0)
162+ , Semialign
163+#endif
164+ )
161165
162166#if MIN_VERSION_containers(0,5,9)
163167deriving instance (Ord k) => Eq1 (MonoidalMap k)