on develop help sign in
Make RequesterT tests build again
3785bc0Tom Smalley
reflex.cabal+3−1
@@ -233,14 +233,16 @@ test-suite RequesterT
233 main-is: RequesterT.hs
233 main-is: RequesterT.hs
234 hs-source-dirs: test
234 hs-source-dirs: test
235 build-depends: base
235 build-depends: base
236+ , containers
237+ , deepseq >= 1.3 && < 1.5
236 , dependent-sum
238 , dependent-sum
237 , dependent-map
239 , dependent-map
238 , lens
240 , lens
241+ , mtl
239 , these
242 , these
240 , transformers
243 , transformers
241 , reflex
244 , reflex
242 , ref-tf
245 , ref-tf
243− buildable: False
244 other-modules:
246 other-modules:
245 Reflex.TestPlan
247 Reflex.TestPlan
246 Reflex.Plan.Pure
248 Reflex.Plan.Pure
test/RequesterT.hs+11−9
@@ -1,3 +1,4 @@
1+{-# LANGUAGE BangPatterns #-}
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE GADTs #-}
3{-# LANGUAGE GADTs #-}
3{-# LANGUAGE RankNTypes #-}
4{-# LANGUAGE RankNTypes #-}
@@ -20,18 +21,19 @@ data RequestInt a where
20
21
21main :: IO ()
22main :: IO ()
22main = do
23main = do
23− os1@[[Just [10,9,8,7,6,5,4,3,2,1]]] <- runApp' (unwrapApp testOrdering) $
24+ os1 <- runApp' (unwrapApp testOrdering) $
24 [ Just ()
25 [ Just ()
25 ]
26 ]
26 print os1
27 print os1
27− os2@[[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]]
28+ let ![[Just [10,9,8,7,6,5,4,3,2,1]]] = os1
28− <- runApp' (unwrapApp testSimultaneous) $ map Just $
29+ os2 <- runApp' (unwrapApp testSimultaneous) $ map Just $
29− [ This ()
30+ [ This ()
30− , That ()
31+ , That ()
31− , This ()
32+ , This ()
32− , These () ()
33+ , These () ()
33− ]
34+ ]
34 print os2
35 print os2
36+ let ![[Just [1,3,5,7,9]],[Nothing,Nothing],[Just [2,4,6,8,10]],[Just [2,4,6,8,10],Nothing]] = os2
35 return ()
37 return ()
36
38
37unwrapRequest :: DSum tag RequestInt -> Int
39unwrapRequest :: DSum tag RequestInt -> Int
@@ -43,7 +45,7 @@ unwrapApp :: ( Reflex t, Monad m )
43 -> m (Event t [Int])
45 -> m (Event t [Int])
44unwrapApp x appIn = do
46unwrapApp x appIn = do
45 ((), e) <- runRequesterT (x appIn) never
47 ((), e) <- runRequesterT (x appIn) never
46− return $ fmap (map unwrapRequest . DMap.toList) e
48+ return $ fmap (map unwrapRequest . requesterDataToList) e
47
49
48testOrdering :: ( Response m ~ Identity
50testOrdering :: ( Response m ~ Identity
49 , Request m ~ RequestInt
51 , Request m ~ RequestInt