1
+ {-# LANGUAGE BangPatterns #-}
1
2
{-# LANGUAGE FlexibleContexts #-}
2
3
{-# LANGUAGE GADTs #-}
3
4
{-# LANGUAGE RankNTypes #-}
@@ -20,18 +21,19 @@ data RequestInt a where
20
21
21
22
main :: IO ()
22
23
main = do
23
- os1@ [[ Just [ 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ]]] <- runApp' (unwrapApp testOrdering) $
24
+ os1 <- runApp' (unwrapApp testOrdering) $
24
25
[ Just ()
25
26
]
26
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
- <- runApp' (unwrapApp testSimultaneous) $ map Just $
29
- [ This ()
30
- , That ()
31
- , This ()
32
- , These () ()
33
- ]
28
+ let ! [[Just [10 , 9 , 8 ,7 ,6 , 5 , 4 , 3 , 2 , 1 ]]] = os1
29
+ os2 <- runApp' (unwrapApp testSimultaneous) $ map Just $
30
+ [ This ()
31
+ , That ()
32
+ , This ()
33
+ , These () ()
34
+ ]
34
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
37
return ()
36
38
37
39
unwrapRequest :: DSum tag RequestInt -> Int
@@ -43,7 +45,7 @@ unwrapApp :: ( Reflex t, Monad m )
43
45
-> m (Event t [Int ])
44
46
unwrapApp x appIn = do
45
47
(() , e) <- runRequesterT (x appIn) never
46
- return $ fmap (map unwrapRequest . DMap. toList ) e
48
+ return $ fmap (map unwrapRequest . requesterDataToList ) e
47
49
48
50
testOrdering :: ( Response m ~ Identity
49
51
, Request m ~ RequestInt
0 commit comments