Skip to content

Commit 53559e1

Browse files
committed
Fixes to compile the tests with 8.4.3 on cabal new-*.
1 parent 7cfa682 commit 53559e1

File tree

3 files changed

+51
-7
lines changed

3 files changed

+51
-7
lines changed

reflex.cabal

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,17 @@ test-suite CrossImpl
178178
base,
179179
containers,
180180
dependent-map,
181+
dependent-sum,
182+
deepseq >= 1.3 && < 1.5,
181183
mtl,
184+
transformers,
182185
ref-tf,
183186
reflex
187+
other-modules:
188+
Reflex.Test
189+
Reflex.TestPlan
190+
Reflex.Plan.Reflex
191+
Reflex.Plan.Pure
184192

185193
test-suite hlint
186194
type: exitcode-stdio-1.0
@@ -199,12 +207,21 @@ test-suite EventWriterT
199207
main-is: EventWriterT.hs
200208
hs-source-dirs: test
201209
build-depends: base
210+
, containers
211+
, deepseq >= 1.3 && < 1.5
202212
, dependent-sum
203213
, lens
214+
, mtl
204215
, these
205216
, transformers
206217
, reflex
207218
, ref-tf
219+
other-modules:
220+
Reflex.Test
221+
Reflex.TestPlan
222+
Reflex.Plan.Reflex
223+
Reflex.Plan.Pure
224+
Test.Run
208225

209226
test-suite RequesterT
210227
type: exitcode-stdio-1.0
@@ -219,6 +236,9 @@ test-suite RequesterT
219236
, reflex
220237
, ref-tf
221238
buildable: False
239+
other-modules:
240+
Reflex.TestPlan
241+
Reflex.Plan.Pure
222242

223243
test-suite QueryT
224244
type: exitcode-stdio-1.0
@@ -228,35 +248,59 @@ test-suite QueryT
228248
, containers
229249
, dependent-map
230250
, dependent-sum
251+
, deepseq >= 1.3 && < 1.5
231252
, lens
232253
, monoidal-containers
254+
, mtl
233255
, ref-tf
234256
, reflex
235257
, semigroups
236258
, these
237259
, transformers
238-
other-modules: Test.Run
260+
other-modules:
261+
Test.Run
262+
Reflex.TestPlan
263+
Reflex.Plan.Reflex
264+
Reflex.Plan.Pure
239265

240266
test-suite GC-Semantics
241267
type: exitcode-stdio-1.0
242268
main-is: GC.hs
243269
hs-source-dirs: test
244270
build-depends: base
271+
, containers
245272
, dependent-sum
246273
, dependent-map
274+
, deepseq >= 1.3 && < 1.5
275+
, mtl
247276
, these
248277
, transformers
249278
, reflex
250279
, ref-tf
251280
if impl(ghc < 8)
252281
build-depends: semigroups
282+
other-modules:
283+
Reflex.Plan.Pure
284+
Reflex.Plan.Reflex
285+
Reflex.TestPlan
286+
Test.Run
253287

254288
test-suite rootCleanup
255289
type: exitcode-stdio-1.0
256290
main-is: rootCleanup.hs
257291
hs-source-dirs: test
258292
build-depends: base
293+
, containers
294+
, deepseq >= 1.3 && < 1.5
295+
, dependent-sum
296+
, mtl
259297
, reflex
298+
, ref-tf
299+
, these
300+
other-modules:
301+
Reflex.Plan.Pure
302+
Reflex.TestPlan
303+
Test.Run
260304

261305
benchmark spider-bench
262306
type: exitcode-stdio-1.0

test/QueryT.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ instance Query MyQuery where
2828
type QueryResult MyQuery = ()
2929
crop _ _ = ()
3030

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
3232
type QueryResult (Selector k a) = Selector k (QueryResult a)
3333
crop q r = undefined
3434

3535
newtype Selector k a = Selector { unSelector :: MonoidalMap k a }
3636
deriving (Show, Read, Eq, Ord, Functor)
3737

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
3939
(Selector a) <> (Selector b) = Selector $ fmapMaybe id $ f a b
4040
where
4141
f = alignWith $ \case
@@ -45,14 +45,14 @@ instance (Ord k, Eq a, Monoid a) => Semigroup (Selector k a) where
4545
let z = x `mappend` y
4646
in if z == mempty then Nothing else Just z
4747

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
4949
mempty = Selector AMap.empty
5050
mappend = (<>)
5151

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
5353
negateG = fmap negateG
5454

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)
5656

5757
main :: IO ()
5858
main = do

test/Reflex/Bench/Focused.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ switchMergeBehaviors mapChanges = pull . joinMap <$> holdMap mapChanges
184184

185185
-- | Turn an UpdatedMap into a Dynamic by applying the differences to the initial value
186186
holdMapDyn :: (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
188188

189189
where
190190
modify k Nothing items = Map.delete k items

0 commit comments

Comments
 (0)