on develop help sign in
Merge branch 'develop' into joindyn-intmap
ec8139eElliot Cameron
src/Reflex/Class.hs+7−1
@@ -180,7 +180,7 @@ import Prelude hiding (zip, zipWith)
180import Data.These.Combinators (justThese)
180import Data.These.Combinators (justThese)
181#endif
181#endif
182#if MIN_VERSION_semialign(1,1,0)
182#if MIN_VERSION_semialign(1,1,0)
183−import Data.Zip (Zip (..))
183+import Data.Zip (Zip (..), Unzip (..))
184#endif
184#endif
185#endif
185#endif
186
186
@@ -1091,6 +1091,12 @@ instance Reflex t => Zip (Event t) where
1091 zip x y = mapMaybe justThese $ align x y
1091 zip x y = mapMaybe justThese $ align x y
1092#endif
1092#endif
1093
1093
1094+#ifdef MIN_VERSION_semialign
1095+#if MIN_VERSION_semialign(1,1,0)
1096+instance Reflex t => Unzip (Event t) where
1097+ unzip = splitE
1098+#endif
1099+#endif
1094
1100
1095-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1101-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1096-- the 'Behavior' is true at the time of occurrence.
1102-- the 'Behavior' is true at the time of occurrence.
src/Reflex/Host/Headless.hs+3−5
@@ -43,7 +43,7 @@ type MonadHeadlessApp t m =
43-- | Run a headless FRP network. Inside the action, you will most probably use
43-- | Run a headless FRP network. Inside the action, you will most probably use
44-- the capabilities provided by the 'TriggerEvent' and 'PerformEvent' type
44-- the capabilities provided by the 'TriggerEvent' and 'PerformEvent' type
45-- classes to interface the FRP network with the outside world. Useful for
45-- classes to interface the FRP network with the outside world. Useful for
46−-- testing.
46+-- testing. Each headless network runs on its own spider timeline.
47runHeadlessApp
47runHeadlessApp
48 :: (forall t m. MonadHeadlessApp t m => m (Event t ()))
48 :: (forall t m. MonadHeadlessApp t m => m (Event t ()))
49 -- ^ The action to be run in the headless FRP network. The FRP network is
49 -- ^ The action to be run in the headless FRP network. The FRP network is
@@ -51,10 +51,8 @@ runHeadlessApp
51 -> IO ()
51 -> IO ()
52runHeadlessApp guest =
52runHeadlessApp guest =
53 -- We are using the 'Spider' implementation of reflex. Running the host
53 -- We are using the 'Spider' implementation of reflex. Running the host
54− -- allows us to take actions on the FRP timeline. The scoped type signature
54+ -- allows us to take actions on the FRP timeline.
55− -- specifies that our host runs on the Global timeline.
55+ withSpiderTimeline $ runSpiderHostForTimeline $ do
56− -- For more information, see 'Reflex.Spider.Internal.runSpiderHost'.
57− (runSpiderHost :: SpiderHost Global a -> IO a) $ do
58 -- Create the "post-build" event and associated trigger. This event fires
56 -- Create the "post-build" event and associated trigger. This event fires
59 -- once, when the application starts.
57 -- once, when the application starts.
60 (postBuild, postBuildTriggerRef) <- newEventWithTriggerRef
58 (postBuild, postBuildTriggerRef) <- newEventWithTriggerRef