packages feed

reflex-orphans 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+21/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

reflex-orphans.cabal view
@@ -1,5 +1,5 @@ name:                reflex-orphans-version:             0.1.0.1+version:             0.1.0.2 synopsis:            Useful missing instances for Reflex license:             BSD3 license-file:        LICENSE
src/Reflex/Orphans.hs view
@@ -13,5 +13,6 @@     f <*> x = unsafeDynamic               ((current f) <*> (current x))               (push (\case-                        These a b -> return . Just $ a b-                        _ -> return Nothing) $ align (updated f) (updated x))+                        This a -> (Just . a) <$> (sample . current $ x)+                        That b -> (Just . ($ b)) <$> (sample . current $ f)+                        These a b -> return . Just $ a b) $ align (updated f) (updated x))
test.hs view
@@ -118,6 +118,23 @@               <*> sample pb               <*> (sample . current $ pd))     pb `sameBehavior` (current pd)+    (rea, rmta) <- newEventWithTriggerRef+    (reb, rmtb) <- newEventWithTriggerRef+    fc <- runHostFrame $ do+      a <- holdDyn (1::Int) rea+      b <- holdDyn 1 reb+      return $ (+) <$> a <*> b+    ehc <- subscribeEvent . updated $ fc+    Just at <- readRef rmta+    Just bt <- readRef rmtb+    cr0 <- fireEventsAndRead [] $ eventValue ehc+    liftIO $ Nothing @=? cr0+    cr1 <- fireEventsAndRead [at :=> Identity 2, bt :=> Identity 2] $ eventValue ehc+    liftIO $ (Just 4) @=? cr1+    cr2 <- fireEventsAndRead [at :=> Identity 3] $ eventValue ehc+    liftIO $ (Just 5) @=? cr2+    cr2 <- fireEventsAndRead [bt :=> Identity 3] $ eventValue ehc+    liftIO $ (Just 6) @=? cr2   where     eventValue eh = readEvent eh >>= sequence     checkStep (tv, ved, vba, vbb) = do