@@ -99,6 +99,9 @@ dynText s = do
9999 liftIO $ nodeSetNodeValue n curS
100100 addVoidAction $ fmap (liftIO . nodeSetNodeValue n) $ updated s
101101
102+display :: (MonadWidget t m, Show a) => Dynamic t a -> m ()
103+display a = dynText =<< mapDyn show a
104+
102105--TODO: Should this be renamed to 'widgetView' for consistency with 'widgetHold'?
103106dyn :: MonadWidget t m => Dynamic t (m a) -> m (Event t a)
104107dyn child = do
@@ -257,7 +260,10 @@ listWithKey' initialVals valsChanged mkChild = do
257260
258261--TODO: Something better than Dynamic t (Map k v) - we want something where the Events carry diffs, not the whole value
259262listViewWithKey :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m (Event t a)) -> m (Event t (Map k a))
260−listViewWithKey vals mkChild = do
263+listViewWithKey vals mkChild = liftM (switch . fmap mergeMap) $ listViewWithKey' vals mkChild
264+
265+listViewWithKey' :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m a) -> m (Behavior t (Map k a))
266+listViewWithKey' vals mkChild = do
261267 doc <- askDocument
262268 startPlaceholder <- text' ""
263269 endPlaceholder <- text' ""
@@ -304,7 +310,7 @@ listViewWithKey vals mkChild = do
304310 liftIO $ putStrLn . ("newChildrenTriggerRef is Just? " <>) . show . isJust =<< readRef newChildrenTriggerRef
305311 runFrameWithTriggerRef newChildrenTriggerRef newState
306312 liftIO $ putStrLn "Triggering newChildren done"
307− return $ switch $ fmap (mergeMap . fmap (fst . fst)) children
313+ return $ fmap (fmap (fst . fst)) children
308314
309315--TODO: Deduplicate the various list*WithKey* implementations
310316