on develop help sign in
Fixes to compile the tests with 8.4.3 on cabal new-*.
53559e1davean
reflex.cabal+45−1
@@ -178,9 +178,17 @@ test-suite CrossImpl
178 base,
178 base,
179 containers,
179 containers,
180 dependent-map,
180 dependent-map,
181+ dependent-sum,
182+ deepseq >= 1.3 && < 1.5,
181 mtl,
183 mtl,
184+ transformers,
182 ref-tf,
185 ref-tf,
183 reflex
186 reflex
187+ other-modules:
188+ Reflex.Test
189+ Reflex.TestPlan
190+ Reflex.Plan.Reflex
191+ Reflex.Plan.Pure
184
192
185test-suite hlint
193test-suite hlint
186 type: exitcode-stdio-1.0
194 type: exitcode-stdio-1.0
@@ -199,12 +207,21 @@ test-suite EventWriterT
199 main-is: EventWriterT.hs
207 main-is: EventWriterT.hs
200 hs-source-dirs: test
208 hs-source-dirs: test
201 build-depends: base
209 build-depends: base
210+ , containers
211+ , deepseq >= 1.3 && < 1.5
202 , dependent-sum
212 , dependent-sum
203 , lens
213 , lens
214+ , mtl
204 , these
215 , these
205 , transformers
216 , transformers
206 , reflex
217 , reflex
207 , ref-tf
218 , ref-tf
219+ other-modules:
220+ Reflex.Test
221+ Reflex.TestPlan
222+ Reflex.Plan.Reflex
223+ Reflex.Plan.Pure
224+ Test.Run
208
225
209test-suite RequesterT
226test-suite RequesterT
210 type: exitcode-stdio-1.0
227 type: exitcode-stdio-1.0
@@ -219,6 +236,9 @@ test-suite RequesterT
219 , reflex
236 , reflex
220 , ref-tf
237 , ref-tf
221 buildable: False
238 buildable: False
239+ other-modules:
240+ Reflex.TestPlan
241+ Reflex.Plan.Pure
222
242
223test-suite QueryT
243test-suite QueryT
224 type: exitcode-stdio-1.0
244 type: exitcode-stdio-1.0
@@ -228,35 +248,59 @@ test-suite QueryT
228 , containers
248 , containers
229 , dependent-map
249 , dependent-map
230 , dependent-sum
250 , dependent-sum
251+ , deepseq >= 1.3 && < 1.5
231 , lens
252 , lens
232 , monoidal-containers
253 , monoidal-containers
254+ , mtl
233 , ref-tf
255 , ref-tf
234 , reflex
256 , reflex
235 , semigroups
257 , semigroups
236 , these
258 , these
237 , transformers
259 , transformers
238− other-modules: Test.Run
260+ other-modules:
261+ Test.Run
262+ Reflex.TestPlan
263+ Reflex.Plan.Reflex
264+ Reflex.Plan.Pure
239
265
240test-suite GC-Semantics
266test-suite GC-Semantics
241 type: exitcode-stdio-1.0
267 type: exitcode-stdio-1.0
242 main-is: GC.hs
268 main-is: GC.hs
243 hs-source-dirs: test
269 hs-source-dirs: test
244 build-depends: base
270 build-depends: base
271+ , containers
245 , dependent-sum
272 , dependent-sum
246 , dependent-map
273 , dependent-map
274+ , deepseq >= 1.3 && < 1.5
275+ , mtl
247 , these
276 , these
248 , transformers
277 , transformers
249 , reflex
278 , reflex
250 , ref-tf
279 , ref-tf
251 if impl(ghc < 8)
280 if impl(ghc < 8)
252 build-depends: semigroups
281 build-depends: semigroups
282+ other-modules:
283+ Reflex.Plan.Pure
284+ Reflex.Plan.Reflex
285+ Reflex.TestPlan
286+ Test.Run
253
287
254test-suite rootCleanup
288test-suite rootCleanup
255 type: exitcode-stdio-1.0
289 type: exitcode-stdio-1.0
256 main-is: rootCleanup.hs
290 main-is: rootCleanup.hs
257 hs-source-dirs: test
291 hs-source-dirs: test
258 build-depends: base
292 build-depends: base
293+ , containers
294+ , deepseq >= 1.3 && < 1.5
295+ , dependent-sum
296+ , mtl
259 , reflex
297 , reflex
298+ , ref-tf
299+ , these
300+ other-modules:
301+ Reflex.Plan.Pure
302+ Reflex.TestPlan
303+ Test.Run
260
304
261benchmark spider-bench
305benchmark spider-bench
262 type: exitcode-stdio-1.0
306 type: exitcode-stdio-1.0
test/QueryT.hs+5−5
@@ -28,14 +28,14 @@ instance Query MyQuery where
28 type QueryResult MyQuery = ()
28 type QueryResult MyQuery = ()
29 crop _ _ = ()
29 crop _ _ = ()
30
30
31−instance (Ord k, Query a, Eq (QueryResult a)) => Query (Selector k a) where
31+instance (Ord k, Query a, Eq (QueryResult a), Align (MonoidalMap k)) => Query (Selector k a) where
32 type QueryResult (Selector k a) = Selector k (QueryResult a)
32 type QueryResult (Selector k a) = Selector k (QueryResult a)
33 crop q r = undefined
33 crop q r = undefined
34
34
35newtype Selector k a = Selector { unSelector :: MonoidalMap k a }
35newtype Selector k a = Selector { unSelector :: MonoidalMap k a }
36 deriving (Show, Read, Eq, Ord, Functor)
36 deriving (Show, Read, Eq, Ord, Functor)
37
37
38−instance (Ord k, Eq a, Monoid a) => Semigroup (Selector k a) where
38+instance (Ord k, Eq a, Monoid a, Align (MonoidalMap k)) => Semigroup (Selector k a) where
39 (Selector a) <> (Selector b) = Selector $ fmapMaybe id $ f a b
39 (Selector a) <> (Selector b) = Selector $ fmapMaybe id $ f a b
40 where
40 where
41 f = alignWith $ \case
41 f = alignWith $ \case
@@ -45,14 +45,14 @@ instance (Ord k, Eq a, Monoid a) => Semigroup (Selector k a) where
45 let z = x `mappend` y
45 let z = x `mappend` y
46 in if z == mempty then Nothing else Just z
46 in if z == mempty then Nothing else Just z
47
47
48−instance (Ord k, Eq a, Monoid a) => Monoid (Selector k a) where
48+instance (Ord k, Eq a, Monoid a, Align (MonoidalMap k)) => Monoid (Selector k a) where
49 mempty = Selector AMap.empty
49 mempty = Selector AMap.empty
50 mappend = (<>)
50 mappend = (<>)
51
51
52−instance (Eq a, Ord k, Group a) => Group (Selector k a) where
52+instance (Eq a, Ord k, Group a, Align (MonoidalMap k)) => Group (Selector k a) where
53 negateG = fmap negateG
53 negateG = fmap negateG
54
54
55−instance (Eq a, Ord k, Group a) => Additive (Selector k a)
55+instance (Eq a, Ord k, Group a, Align (MonoidalMap k)) => Additive (Selector k a)
56
56
57main :: IO ()
57main :: IO ()
58main = do
58main = do
test/Reflex/Bench/Focused.hs+1−1
@@ -184,7 +184,7 @@ switchMergeBehaviors mapChanges = pull . joinMap <$> holdMap mapChanges
184
184
185-- | Turn an UpdatedMap into a Dynamic by applying the differences to the initial value
185-- | Turn an UpdatedMap into a Dynamic by applying the differences to the initial value
186holdMapDyn :: (Reflex t, MonadHold t m, MonadFix m, Ord k) => UpdatedMap t k a -> m (Dynamic t (Map k a))
186holdMapDyn :: (Reflex t, MonadHold t m, MonadFix m, Ord k) => UpdatedMap t k a -> m (Dynamic t (Map k a))
187−holdMapDyn (UpdatedMap initial changes) = foldDyn (flip (Map.foldWithKey modify)) initial changes
187+holdMapDyn (UpdatedMap initial changes) = foldDyn (flip (Map.foldrWithKey modify)) initial changes
188
188
189 where
189 where
190 modify k Nothing items = Map.delete k items
190 modify k Nothing items = Map.delete k items