@@ -127,8 +127,9 @@ widgetHold child0 newChild = do
127127widgetHoldInternal :: MonadWidget t m => m a -> Event t (m b) -> m (a, Event t b)
128128widgetHoldInternal child0 newChild = do
129129 startPlaceholder <- text' ""
130− p <- askParent
131− (result0, childVoidAction0) <- subWidgetWithVoidActions p child0
130+ (result0, childVoidAction0) <- do
131+ p <- askParent
132+ subWidgetWithVoidActions p child0
132133 endPlaceholder <- text' ""
133134 (newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
134135 performEvent_ $ fmap (const $ return ()) newChildBuilt --TODO: Get rid of this hack
@@ -141,12 +142,8 @@ widgetHoldInternal child0 newChild = do
141142 (result, postBuild, voidActions) <- runWidget df c
142143 runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
143144 postBuild
144− mp <- liftIO $ nodeGetParentNode endPlaceholder
145− case mp of
146− Nothing -> return () --TODO: Is this right?
147− Just p -> do
148− _ <- liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
149− return ()
145+ mp' <- liftIO $ nodeGetParentNode endPlaceholder
146+ forM_ mp' $ \p' -> liftIO $ nodeInsertBefore p' (Just df) (Just endPlaceholder)
150147 return ()
151148 addVoidAction $ ffor newChild $ \c -> do
152149 liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
@@ -156,7 +153,7 @@ widgetHoldInternal child0 newChild = do
156153diffMapNoEq :: (Ord k) => Map k v -> Map k v -> Map k (Maybe v)
157154diffMapNoEq olds news = flip Map.mapMaybe (align olds news) $ \case
158155 This _ -> Just Nothing
159− These old new -> Just $ Just new
156+ These _ new -> Just $ Just new
160157 That new -> Just $ Just new
161158
162159applyMap :: Ord k => Map k v -> Map k (Maybe v) -> Map k v
@@ -187,7 +184,7 @@ listWithKeyShallowDiff :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k
187184listWithKeyShallowDiff initialVals valsChanged mkChild = do
188185 let childValChangedSelector = fanMap $ fmap (Map.mapMaybe id) valsChanged
189186 sentVals <- foldDyn (flip applyMap) Map.empty $ fmap (fmap (fmap (\_ -> ()))) valsChanged
190− let relevantDiff diff cur = case diff of
187+ let relevantDiff diff _ = case diff of
191188 Nothing -> Just Nothing -- Even if we let a Nothing through when the element doesn't already exist, this doesn't cause a problem because it is ignored
192189 Just _ -> Nothing -- We don't want to let spurious re-creations of items through
193190 listHoldWithKey initialVals (attachWith (flip (Map.differenceWith relevantDiff)) (current sentVals) valsChanged) $ \k v ->
@@ -669,7 +666,7 @@ class HasDomEvent t a | a -> t where
669666 domEvent :: EventName en -> a -> Event t (EventResultType en)
670667
671668instance Reflex t => HasDomEvent t (El t) where
672− domEvent en el = fmap unEventResult $ select (_el_events el) (WrapArg en)
669+ domEvent en e = fmap unEventResult $ select (_el_events e) (WrapArg en)
673670
674671linkClass :: MonadWidget t m => String -> String -> m (Link t)
675672linkClass s c = do