on develop help sign in
Merge remote-tracking branch 'origin/aa-dependent-sum-0.5' into develop

* origin/aa-dependent-sum-0.5: Bump dependent-sum; Remove reliance on EqTag

commitdef4c3051931f3fc77c04c8f46730f9f28b4d5a5 authorAli Abrar <aliabrar@gmail.com> dateFri 14 Jun 2019, 13:09 (7 years ago) parent9bc1c19d69cfc7
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
@@ -44,6 +44,7 @@ library
4444 base >= 4.9 && < 4.13,
4545 bifunctors >= 5.2 && < 5.6,
4646 comonad,
47+ constraints-extras >= 0.2,
4748 containers >= 0.5 && < 0.7,
4849 data-default >= 0.5 && < 0.8,
4950 dependent-map >= 0.2.4 && < 0.3,
@@ -133,7 +134,7 @@ library
133134 if flag(use-template-haskell)
134135 cpp-options: -DUSE_TEMPLATE_HASKELL
135136 build-depends:
136− dependent-sum >= 0.5 && < 0.6,
137+ dependent-sum >= 0.6 && < 0.7,
137138 haskell-src-exts >= 1.16 && < 1.22,
138139 haskell-src-meta >= 0.6 && < 0.9,
139140 template-haskell >= 2.9 && < 2.15
@@ -142,7 +143,7 @@ library
142143 other-extensions: TemplateHaskell
143144 else
144145 build-depends:
145− dependent-sum == 0.5.*
146+ dependent-sum == 0.6.*
146147
147148 if flag(fast-weak) && impl(ghcjs)
148149 cpp-options: -DGHCJS_FAST_WEAK
src/Data/Functor/Misc.hs−8
@@ -79,9 +79,6 @@ deriving instance Read k => Read (Const2 k v v)
7979instance Show k => GShow (Const2 k v) where
8080 gshowsPrec n x@(Const2 _) = showsPrec n x
8181
82−instance (Show k, Show (f v)) => ShowTag (Const2 k v) f where
83− showTaggedPrec (Const2 _) = showsPrec
84−
8582instance Eq k => GEq (Const2 k v) where
8683 geq (Const2 a) (Const2 b) =
8784 if a == b
@@ -214,11 +211,6 @@ instance GShow (EitherTag l r) where
214211 LeftTag -> showString "LeftTag"
215212 RightTag -> showString "RightTag"
216213
217−instance (Show l, Show r) => ShowTag (EitherTag l r) Identity where
218− showTaggedPrec t n (Identity a) = case t of
219− LeftTag -> showsPrec n a
220− RightTag -> showsPrec n a
221−
222214-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
223215eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
224216eitherToDSum = \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)