@@ -39,7 +39,6 @@ Since MonadWidget depends on MonadHold and MonadHold depends on MonadSample, any
3939[ ] ffilter :: (a -> Bool) -> Event a -> Event a
4040[ ] ffor :: Event a -> (a -> b) -> Event b
4141[ ] fforMaybe :: Event a -> (a -> Maybe b) -> Event b
42−[ ] splitE :: Event (a, b) -> (Event a, Event b)
4342
4443-- Event to identical Event with debug trace.
4544[ ] traceEvent :: Show a => String -> Event a -> Event a
@@ -80,32 +79,6 @@ Since MonadWidget depends on MonadHold and MonadHold depends on MonadSample, any
8079[H] headTailE :: Event a -> m (Event a, Event a)
8180```
8281
83−### Event flattening functions
84−
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.
86−
87−```haskell
88−-- Flatten Event-of-Event to monadic Event. New Event is used immediately.
89−[H] switchPromptly :: Event a -> Event (Event a) -> m (Event a)
90−
91−-- Flatten Behavior-of-Event to Event. Old Event is used during switchover.
92−[ ] switch :: Behavior (Event a) -> Event a
93−
94−-- Flatten Dyanmic-of-Event to Event. New Event is used immediately.
95−[ ] switchPromptlyDyn :: Dynamic (Event a) -> Event a
96−
97−-- Flatten Event-of-Event to Event that fires when both wrapper and new Event fire.
98−[ ] coincidence :: Event (Event a) -> Event a
99−
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)
104−
105−-- Flatten Event-of-Behavior to monadic Behavior
106−[H] switcher :: Behavior a -> Event (Behavior a) -> m (Behavior a)
107−```
108−
10982### Functions producing Behavior
11083
11184```haskell
@@ -170,6 +143,34 @@ These functions flatten Event-of-Event, Behavior-of-Event, or Dynamic-of-Event i
170143[ ] traceDynWith :: (a -> String) -> Dynamic a -> Dynamic a
171144```
172145
146+### Flattening functions
147+
148+These functions flatten nested types such as Event-of-Event, Behavior-of-Event, Event-of-Behavior etc, removing the outer wrapper.
149+
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.
151+
152+```haskell
153+-- Flatten Event-of-Event to monadic Event. New Event is used immediately.
154+[H] switchPromptly :: Event a -> Event (Event a) -> m (Event a)
155+
156+-- Flatten Behavior-of-Event to Event. Old Event is used during switchover.
157+[ ] switch :: Behavior (Event a) -> Event a
158+
159+-- Flatten Dyanmic-of-Event to Event. New Event is used immediately.
160+[ ] switchPromptlyDyn :: Dynamic (Event a) -> Event a
161+
162+-- Flatten Event-of-Event to Event that fires when both wrapper AND new Event fire.
163+[ ] coincidence :: Event (Event a) -> Event a
164+
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)
169+
170+-- Flatten Event-of-Behavior to monadic Behavior
171+[H] switcher :: Behavior a -> Event (Behavior a) -> m (Behavior a)
172+```
173+
173174## Reflex-Dom
174175
175176### Creating widgets (DOM elements hooked into the FRP system)