on develop help sign in
Merge remote-tracking branch 'origin/aa-dependent-sum-0.5' into develop
def4c30Ali Abrar
reflex.cabal+3−2
@@ -44,6 +44,7 @@ library
44 base >= 4.9 && < 4.13,
44 base >= 4.9 && < 4.13,
45 bifunctors >= 5.2 && < 5.6,
45 bifunctors >= 5.2 && < 5.6,
46 comonad,
46 comonad,
47+ constraints-extras >= 0.2,
47 containers >= 0.5 && < 0.7,
48 containers >= 0.5 && < 0.7,
48 data-default >= 0.5 && < 0.8,
49 data-default >= 0.5 && < 0.8,
49 dependent-map >= 0.2.4 && < 0.3,
50 dependent-map >= 0.2.4 && < 0.3,
@@ -133,7 +134,7 @@ library
133 if flag(use-template-haskell)
134 if flag(use-template-haskell)
134 cpp-options: -DUSE_TEMPLATE_HASKELL
135 cpp-options: -DUSE_TEMPLATE_HASKELL
135 build-depends:
136 build-depends:
136− dependent-sum >= 0.5 && < 0.6,
137+ dependent-sum >= 0.6 && < 0.7,
137 haskell-src-exts >= 1.16 && < 1.22,
138 haskell-src-exts >= 1.16 && < 1.22,
138 haskell-src-meta >= 0.6 && < 0.9,
139 haskell-src-meta >= 0.6 && < 0.9,
139 template-haskell >= 2.9 && < 2.15
140 template-haskell >= 2.9 && < 2.15
@@ -142,7 +143,7 @@ library
142 other-extensions: TemplateHaskell
143 other-extensions: TemplateHaskell
143 else
144 else
144 build-depends:
145 build-depends:
145− dependent-sum == 0.5.*
146+ dependent-sum == 0.6.*
146
147
147 if flag(fast-weak) && impl(ghcjs)
148 if flag(fast-weak) && impl(ghcjs)
148 cpp-options: -DGHCJS_FAST_WEAK
149 cpp-options: -DGHCJS_FAST_WEAK
src/Data/Functor/Misc.hs−8
@@ -79,9 +79,6 @@ deriving instance Read k => Read (Const2 k v v)
79instance Show k => GShow (Const2 k v) where
79instance Show k => GShow (Const2 k v) where
80 gshowsPrec n x@(Const2 _) = showsPrec n x
80 gshowsPrec n x@(Const2 _) = showsPrec n x
81
81
82−instance (Show k, Show (f v)) => ShowTag (Const2 k v) f where
83− showTaggedPrec (Const2 _) = showsPrec
84−
85instance Eq k => GEq (Const2 k v) where
82instance Eq k => GEq (Const2 k v) where
86 geq (Const2 a) (Const2 b) =
83 geq (Const2 a) (Const2 b) =
87 if a == b
84 if a == b
@@ -214,11 +211,6 @@ instance GShow (EitherTag l r) where
214 LeftTag -> showString "LeftTag"
211 LeftTag -> showString "LeftTag"
215 RightTag -> showString "RightTag"
212 RightTag -> showString "RightTag"
216
213
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−
222-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
214-- | Convert 'Either' to a 'DSum'. Inverse of 'dsumToEither'.
223eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
215eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
224eitherToDSum = \case
216eitherToDSum = \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)