on develop help sign in
Bump dependent-sum; Remove reliance on EqTag
commitd69cfc7d238ac37e52c5553488b754284f28f2bd authorAli Abrar <aliabrar@gmail.com> dateFri 8 Feb 2019, 22:09 (8 years ago) parent49c1dec
3 files changed+6−13
reflex.cabal+3−2 src/Data/Functor/Misc.hs−8 src/Reflex/Patch/DMapWithMove.hs+3−3
reflex.cabal+3−2
@@ -43,6 +43,7 @@ library
4343 base >= 4.9 && < 4.13,
4444 bifunctors >= 5.2 && < 5.6,
4545 comonad,
46+ constraints-extras >= 0.2,
4647 containers >= 0.5 && < 0.7,
4748 data-default >= 0.5 && < 0.8,
4849 dependent-map >= 0.2.4 && < 0.3,
@@ -131,7 +132,7 @@ library
131132 if flag(use-template-haskell)
132133 cpp-options: -DUSE_TEMPLATE_HASKELL
133134 build-depends:
134− dependent-sum >= 0.3 && < 0.5,
135+ dependent-sum >= 0.5,
135136 haskell-src-exts >= 1.16 && < 1.21,
136137 haskell-src-meta >= 0.6 && < 0.9,
137138 template-haskell >= 2.9 && < 2.15
@@ -140,7 +141,7 @@ library
140141 other-extensions: TemplateHaskell
141142 else
142143 build-depends:
143− dependent-sum == 0.4.*
144+ dependent-sum >= 0.5
144145
145146 if flag(fast-weak) && impl(ghcjs)
146147 cpp-options: -DGHCJS_FAST_WEAK
src/Data/Functor/Misc.hs−8
@@ -86,9 +86,6 @@ deriving instance Read k => Read (Const2 k v v)
8686instance Show k => GShow (Const2 k v) where
8787 gshowsPrec n x@(Const2 _) = showsPrec n x
8888
89−instance (Show k, Show (f v)) => ShowTag (Const2 k v) f where
90− showTaggedPrec (Const2 _) = showsPrec
91−
9289instance Eq k => GEq (Const2 k v) where
9390 geq (Const2 a) (Const2 b) =
9491 if a == b
@@ -221,11 +218,6 @@ instance GShow (EitherTag l r) where
221218 LeftTag -> showString "LeftTag"
222219 RightTag -> showString "RightTag"
223220
224−instance (Show l, Show r) => ShowTag (EitherTag l r) Identity where
225− showTaggedPrec t n (Identity a) = case t of
226− LeftTag -> showsPrec n a
227− RightTag -> showsPrec n a
228−
229221-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
230222eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
231223eitherToDSum = \case
src/Reflex/Patch/DMapWithMove.hs+3−3
@@ -19,9 +19,9 @@ import Reflex.Patch.Class
1919import Reflex.Patch.MapWithMove (PatchMapWithMove (..))
2020import qualified Reflex.Patch.MapWithMove as MapWithMove
2121
22+import Data.Constraint.Extras
2223import Data.Dependent.Map (DMap, DSum (..), GCompare (..))
2324import qualified Data.Dependent.Map as DMap
24−import Data.Dependent.Sum (EqTag (..))
2525import Data.Functor.Constant
2626import Data.Functor.Misc
2727import Data.Functor.Product
@@ -105,8 +105,8 @@ validationErrorsForPatchDMapWithMove m =
105105 unbalancedMove _ = Nothing
106106
107107-- |Test whether two @'PatchDMapWithMove' k v@ contain the same patch operations.
108−instance EqTag k (NodeInfo k v) => Eq (PatchDMapWithMove k v) where
109− PatchDMapWithMove a == PatchDMapWithMove b = a == b
108+instance (GEq k, Has' Eq k (NodeInfo k v)) => Eq (PatchDMapWithMove k v) where
109+ PatchDMapWithMove a == PatchDMapWithMove b = a == b
110110
111111-- |Higher kinded 2-tuple, identical to @Data.Functor.Product@ from base ≥ 4.9
112112data Pair1 f g a = Pair1 (f a) (g a)