@@ -39,7 +39,6 @@ Since MonadWidget depends on MonadHold and MonadHold depends on MonadSample, any
39[ ] ffilter :: (a -> Bool) -> Event a -> Event a
39[ ] ffilter :: (a -> Bool) -> Event a -> Event a
40[ ] ffor :: Event a -> (a -> b) -> Event b
40[ ] ffor :: Event a -> (a -> b) -> Event b
41[ ] fforMaybe :: Event a -> (a -> Maybe b) -> Event b
41[ ] fforMaybe :: Event a -> (a -> Maybe b) -> Event b
42−[ ] splitE :: Event (a, b) -> (Event a, Event b)
44-- Event to identical Event with debug trace.
43-- Event to identical Event with debug trace.
45[ ] traceEvent :: Show a => String -> Event a -> Event a
44[ ] traceEvent :: Show a => String -> Event a -> Event a
@@ -80,32 +79,6 @@ Since MonadWidget depends on MonadHold and MonadHold depends on MonadSample, any
80[H] headTailE :: Event a -> m (Event a, Event a)
79[H] headTailE :: Event a -> m (Event a, Event a)
83−### Event flattening functions
85−These functions flatten Event-of-Event, Behavior-of-Event, or Dynamic-of-Event into Event, where the returned Event fires whenever the latest Event supplied by the wrapper fires. There are subtle differences in how they handle *coincidences* -- situations where the old or new Event fires at the same instant that we switch from old to new. In some cases, the output Event tracks the old Event at the instant of switchover, while in other cases it tracks the new Event.
88−-- Flatten Event-of-Event to monadic Event. New Event is used immediately.
89−[H] switchPromptly :: Event a -> Event (Event a) -> m (Event a)
91−-- Flatten Behavior-of-Event to Event. Old Event is used during switchover.
92−[ ] switch :: Behavior (Event a) -> Event a
94−-- Flatten Dyanmic-of-Event to Event. New Event is used immediately.
95−[ ] switchPromptlyDyn :: Dynamic (Event a) -> Event a
97−-- Flatten Event-of-Event to Event that fires when both wrapper and new Event fire.
98−[ ] coincidence :: Event (Event a) -> Event a
100−-- Flatten Dynamic-of-Dynamic to Dynamic. New Dynamic is used immediately.
101−-- Output updated whenever inner or outer Dynamic updates.
102−[ ] joinDyn :: Dynamic (Dynamic a) -> Dynamic a
103−[ ] joinDynThroughMap :: Ord k => Dynamic (Map k (Dynamic a)) -> Dynamic (Map k a)
105−-- Flatten Event-of-Behavior to monadic Behavior
106−[H] switcher :: Behavior a -> Event (Behavior a) -> m (Behavior a)
109### Functions producing Behavior
82### Functions producing Behavior
111```haskell
84```haskell
@@ -170,6 +143,34 @@ These functions flatten Event-of-Event, Behavior-of-Event, or Dynamic-of-Event i
170[ ] traceDynWith :: (a -> String) -> Dynamic a -> Dynamic a
143[ ] traceDynWith :: (a -> String) -> Dynamic a -> Dynamic a
146+### Flattening functions
148+These functions flatten nested types such as Event-of-Event, Behavior-of-Event, Event-of-Behavior etc, removing the outer wrapper.
150+For Events, the returned Event fires whenever the latest Event supplied by the wrapper fires. There are differences in how the functions handle *coincidences* -- situations where the old or new Event fires at the same instant that we switch from old to new. In some cases, the output Event tracks the old Event at the instant of switchover, while in other cases it tracks the new Event.
153+-- Flatten Event-of-Event to monadic Event. New Event is used immediately.
154+[H] switchPromptly :: Event a -> Event (Event a) -> m (Event a)
156+-- Flatten Behavior-of-Event to Event. Old Event is used during switchover.
157+[ ] switch :: Behavior (Event a) -> Event a
159+-- Flatten Dyanmic-of-Event to Event. New Event is used immediately.
160+[ ] switchPromptlyDyn :: Dynamic (Event a) -> Event a
162+-- Flatten Event-of-Event to Event that fires when both wrapper AND new Event fire.
163+[ ] coincidence :: Event (Event a) -> Event a
165+-- Flatten Dynamic-of-Dynamic to Dynamic. New Dynamic is used immediately.
166+-- Output updated whenever inner OR outer Dynamic updates.
167+[ ] joinDyn :: Dynamic (Dynamic a) -> Dynamic a
168+[ ] joinDynThroughMap :: Ord k => Dynamic (Map k (Dynamic a)) -> Dynamic (Map k a)
170+-- Flatten Event-of-Behavior to monadic Behavior
171+[H] switcher :: Behavior a -> Event (Behavior a) -> m (Behavior a)
173## Reflex-Dom
174## Reflex-Dom
175### Creating widgets (DOM elements hooked into the FRP system)
176### Creating widgets (DOM elements hooked into the FRP system)