on develop help sign in
Add withSpiderTimeline.
commitfcab3230aed954357e26baec4bce96c629b64704 authorErtugrul Söylemez <esz@posteo.de> dateThu 18 Aug 2016, 21:09 (10 years ago) parent1511d28
1 file changed+5−1
src/Reflex/Spider/Internal.hs+5−1
src/Reflex/Spider/Internal.hs+5−1
@@ -2021,7 +2021,11 @@ unsafeNewSpiderTimeline = do
20212021
20222022-- | Create a new SpiderTimeline
20232023newSpiderTimeline :: IO (Some SpiderTimeline)
2024−newSpiderTimeline = Some.This <$> unsafeNewSpiderTimeline
2024+newSpiderTimeline = withSpiderTimeline (pure . Some.This)
2025+
2026+-- | Pass a new timeline to the given function.
2027+withSpiderTimeline :: (forall x. SpiderTimeline x -> IO r) -> IO r
2028+withSpiderTimeline k = unsafeNewSpiderTimeline >>= k
20252029
20262030newtype SpiderPullM x a = SpiderPullM (BehaviorM a) deriving (Functor, Applicative, Monad, MonadIO, MonadFix)
20272031