1{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE RankNTypes #-}
4{-# LANGUAGE ScopedTypeVariables #-}
9import qualified Data.Dependent.Map as DMap
10import Data.Dependent.Sum
14import Reflex.Requester.Base
15import Reflex.Requester.Class
18data RequestInt a where
19 RequestInt :: Int -> RequestInt Int
23 os1@[[Just [10,9,8,7,6,5,4,3,2,1]]] <- runApp' (unwrapApp testOrdering) $
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 $
37unwrapRequest :: DSum tag RequestInt -> Int
38unwrapRequest (_ :=> RequestInt i) = i
40unwrapApp :: ( Reflex t, Monad m )
41 => (a -> RequesterT t RequestInt Identity m ())
45 ((), e) <- runRequesterT (x appIn) never
46 return $ fmap (map unwrapRequest . DMap.toList) e
48testOrdering :: ( Response m ~ Identity
49 , Request m ~ RequestInt
54testOrdering pulse = forM_ [10,9..1] $ \i ->
55 requestingIdentity (RequestInt i <$ pulse)
57testSimultaneous :: ( Response m ~ Identity
58 , Request m ~ RequestInt
61 => Event t (These () ())
63testSimultaneous pulse = do
64 let tellE = fmapMaybe (^? here) pulse
65 switchE = fmapMaybe (^? there) pulse
66 forM_ [1,3..9] $ \i -> runWithReplace (requestingIdentity (RequestInt i <$ tellE)) $ ffor switchE $ \_ ->
67 requestingIdentity (RequestInt (i+1) <$ tellE)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list