on develop help sign in
Fix build for QueryT test

Newer versions than 0.4.0.0 of monoidal-containers will include an align instance, but it is not present in hackage yet.

commit90642eea2d836e74a4b411465001796c93be6331 authorLuigy Leon <luichi.19@gmail.com> dateWed 16 Jan 2019, 13:27 (8 years ago) parent185e4ea
1 file changed+6−1
test/QueryT.hs+6−1
test/QueryT.hs+6−1
@@ -1,15 +1,16 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE DeriveFunctor #-}
23{-# LANGUAGE FlexibleContexts #-}
34{-# LANGUAGE GeneralizedNewtypeDeriving #-}
45{-# LANGUAGE LambdaCase #-}
56{-# LANGUAGE RankNTypes #-}
7+{-# LANGUAGE StandaloneDeriving #-}
68{-# LANGUAGE TypeFamilies #-}
79{-# LANGUAGE UndecidableInstances #-}
810
911import Control.Lens
1012import Control.Monad.Fix
1113import Data.Align
12−import Data.AppendMap () -- for the Align instance
1314import qualified Data.AppendMap as AMap
1415import Data.Functor.Misc
1516import Data.Map (Map)
@@ -36,6 +37,10 @@ instance (Ord k, Query a, Eq (QueryResult a), Align (MonoidalMap k)) => Query (S
3637newtype Selector k a = Selector { unSelector :: MonoidalMap k a }
3738 deriving (Show, Read, Eq, Ord, Functor)
3839
40+#if !(MIN_VERSION_monoidal_containers(0,4,1))
41+deriving instance Ord k => Align (MonoidalMap k)
42+#endif
43+
3944instance (Ord k, Eq a, Monoid a, Align (MonoidalMap k)) => Semigroup (Selector k a) where
4045 (Selector a) <> (Selector b) = Selector $ fmapMaybe id $ f a b
4146 where