on develop help sign in
Bump dependent-sum; Remove reliance on EqTag
d69cfc7Ali Abrar
reflex.cabal+3−2
@@ -43,6 +43,7 @@ library
43 base >= 4.9 && < 4.13,
43 base >= 4.9 && < 4.13,
44 bifunctors >= 5.2 && < 5.6,
44 bifunctors >= 5.2 && < 5.6,
45 comonad,
45 comonad,
46+ constraints-extras >= 0.2,
46 containers >= 0.5 && < 0.7,
47 containers >= 0.5 && < 0.7,
47 data-default >= 0.5 && < 0.8,
48 data-default >= 0.5 && < 0.8,
48 dependent-map >= 0.2.4 && < 0.3,
49 dependent-map >= 0.2.4 && < 0.3,
@@ -131,7 +132,7 @@ library
131 if flag(use-template-haskell)
132 if flag(use-template-haskell)
132 cpp-options: -DUSE_TEMPLATE_HASKELL
133 cpp-options: -DUSE_TEMPLATE_HASKELL
133 build-depends:
134 build-depends:
134− dependent-sum >= 0.3 && < 0.5,
135+ dependent-sum >= 0.5,
135 haskell-src-exts >= 1.16 && < 1.21,
136 haskell-src-exts >= 1.16 && < 1.21,
136 haskell-src-meta >= 0.6 && < 0.9,
137 haskell-src-meta >= 0.6 && < 0.9,
137 template-haskell >= 2.9 && < 2.15
138 template-haskell >= 2.9 && < 2.15
@@ -140,7 +141,7 @@ library
140 other-extensions: TemplateHaskell
141 other-extensions: TemplateHaskell
141 else
142 else
142 build-depends:
143 build-depends:
143− dependent-sum == 0.4.*
144+ dependent-sum >= 0.5
144
145
145 if flag(fast-weak) && impl(ghcjs)
146 if flag(fast-weak) && impl(ghcjs)
146 cpp-options: -DGHCJS_FAST_WEAK
147 cpp-options: -DGHCJS_FAST_WEAK
src/Data/Functor/Misc.hs−8
@@ -86,9 +86,6 @@ deriving instance Read k => Read (Const2 k v v)
86instance Show k => GShow (Const2 k v) where
86instance Show k => GShow (Const2 k v) where
87 gshowsPrec n x@(Const2 _) = showsPrec n x
87 gshowsPrec n x@(Const2 _) = showsPrec n x
88
88
89−instance (Show k, Show (f v)) => ShowTag (Const2 k v) f where
90− showTaggedPrec (Const2 _) = showsPrec
91−
92instance Eq k => GEq (Const2 k v) where
89instance Eq k => GEq (Const2 k v) where
93 geq (Const2 a) (Const2 b) =
90 geq (Const2 a) (Const2 b) =
94 if a == b
91 if a == b
@@ -221,11 +218,6 @@ instance GShow (EitherTag l r) where
221 LeftTag -> showString "LeftTag"
218 LeftTag -> showString "LeftTag"
222 RightTag -> showString "RightTag"
219 RightTag -> showString "RightTag"
223
220
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−
229-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
221-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
230eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
222eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
231eitherToDSum = \case
223eitherToDSum = \case
src/Reflex/Patch/DMapWithMove.hs+3−3
@@ -19,9 +19,9 @@ import Reflex.Patch.Class
19import Reflex.Patch.MapWithMove (PatchMapWithMove (..))
19import Reflex.Patch.MapWithMove (PatchMapWithMove (..))
20import qualified Reflex.Patch.MapWithMove as MapWithMove
20import qualified Reflex.Patch.MapWithMove as MapWithMove
21
21
22+import Data.Constraint.Extras
22import Data.Dependent.Map (DMap, DSum (..), GCompare (..))
23import Data.Dependent.Map (DMap, DSum (..), GCompare (..))
23import qualified Data.Dependent.Map as DMap
24import qualified Data.Dependent.Map as DMap
24−import Data.Dependent.Sum (EqTag (..))
25import Data.Functor.Constant
25import Data.Functor.Constant
26import Data.Functor.Misc
26import Data.Functor.Misc
27import Data.Functor.Product
27import Data.Functor.Product
@@ -105,8 +105,8 @@ validationErrorsForPatchDMapWithMove m =
105 unbalancedMove _ = Nothing
105 unbalancedMove _ = Nothing
106
106
107-- |Test whether two @'PatchDMapWithMove' k v@ contain the same patch operations.
107-- |Test whether two @'PatchDMapWithMove' k v@ contain the same patch operations.
108−instance EqTag k (NodeInfo k v) => Eq (PatchDMapWithMove k v) where
108+instance (GEq k, Has' Eq k (NodeInfo k v)) => Eq (PatchDMapWithMove k v) where
109− PatchDMapWithMove a == PatchDMapWithMove b = a == b
109+ PatchDMapWithMove a == PatchDMapWithMove b = a == b
110
110
111-- |Higher kinded 2-tuple, identical to @Data.Functor.Product@ from base ≥ 4.9
111-- |Higher kinded 2-tuple, identical to @Data.Functor.Product@ from base ≥ 4.9
112data Pair1 f g a = Pair1 (f a) (g a)
112data Pair1 f g a = Pair1 (f a) (g a)