on develop help sign in
Replace 'onceE' with 'headE' in Reflex.Test.CrossImpl
c37900bRyan Trinkle
test/Reflex/Test/CrossImpl.hs+7−7
@@ -130,8 +130,8 @@ testCases =
130 e' <- updated <$> count e
130 e' <- updated <$> count e
131 b' <- hold (0 :: Int) e'
131 b' <- hold (0 :: Int) e'
132 return (b', e')
132 return (b', e')
133− , (,) "onceE-1" $ TestCase (Map.singleton 0 "asdf", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
133+ , (,) "headE-1" $ TestCase (Map.singleton 0 "asdf", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
134− e' <- onceE $ leftmost [e, e]
134+ e' <- headE $ leftmost [e, e]
135 return (b, e')
135 return (b, e')
136 , (,) "switch-1" $ TestCase (Map.singleton 0 "asdf", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
136 , (,) "switch-1" $ TestCase (Map.singleton 0 "asdf", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
137 let e' = fmap (const e) e
137 let e' = fmap (const e) e
@@ -176,7 +176,7 @@ testCases =
176 return (b, e'')
176 return (b, e'')
177 , (,) "switchPromptly-5" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
177 , (,) "switchPromptly-5" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
178 let e' = flip push e $ \_ -> do
178 let e' = flip push e $ \_ -> do
179− Just <$> onceE e
179+ Just <$> headE e
180 e'' <- switchPromptly never e'
180 e'' <- switchPromptly never e'
181 return (b, e'')
181 return (b, e'')
182 , (,) "switchPromptly-6" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
182 , (,) "switchPromptly-6" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
@@ -197,7 +197,7 @@ testCases =
197 e'' = coincidence e'
197 e'' = coincidence e'
198 return (b, e'')
198 return (b, e'')
199 , (,) "coincidence-4" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj"), (3, "asdf")]) $ \(b, e) -> do
199 , (,) "coincidence-4" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj"), (3, "asdf")]) $ \(b, e) -> do
200− let e' = flip pushAlways e $ \_ -> onceE e
200+ let e' = flip pushAlways e $ \_ -> headE e
201 e'' = coincidence e'
201 e'' = coincidence e'
202 return (b, e'')
202 return (b, e'')
203 , (,) "coincidence-5" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer")]) $ \(b, e) -> do
203 , (,) "coincidence-5" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer")]) $ \(b, e) -> do
@@ -217,14 +217,14 @@ testCases =
217 eCoincidences = coincidence $ fmap (const e') e
217 eCoincidences = coincidence $ fmap (const e') e
218 return (b, eCoincidences)
218 return (b, eCoincidences)
219 , (,) "holdWhileFiring" $ TestCase (Map.singleton 0 "zxc", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
219 , (,) "holdWhileFiring" $ TestCase (Map.singleton 0 "zxc", Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
220− eo <- onceE e
220+ eo <- headE e
221 bb <- hold b $ pushAlways (const $ hold "asdf" eo) eo
221 bb <- hold b $ pushAlways (const $ hold "asdf" eo) eo
222 let b' = pull $ sample =<< sample bb
222 let b' = pull $ sample =<< sample bb
223 return (b', e)
223 return (b', e)
224 , (,) "joinDyn" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
224 , (,) "joinDyn" $ TestCase (Map.singleton 0 (0 :: Int), Map.fromList [(1, "qwer"), (2, "lkj")]) $ \(b, e) -> do
225 bb <- hold "b" e
225 bb <- hold "b" e
226− bd <- hold never . fmap (const e) =<< onceE e
226+ bd <- hold never . fmap (const e) =<< headE e
227− eOuter <- pushAlways sample . fmap (const bb) <$> onceE e
227+ eOuter <- pushAlways sample . fmap (const bb) <$> headE e
228 let eInner = switch bd
228 let eInner = switch bd
229 e' = leftmost [eOuter, eInner]
229 e' = leftmost [eOuter, eInner]
230 return (b, e')
230 return (b, e')