on develop help sign in
Fix some warnings
236b4edRyan Trinkle
src-ghc/Reflex/Dom/Internal/Foreign.hs+1−2
@@ -13,7 +13,6 @@ import Graphics.UI.Gtk.WebKit.WebSettings
13import Graphics.UI.Gtk.WebKit.WebFrame
13import Graphics.UI.Gtk.WebKit.WebFrame
14import Graphics.UI.Gtk.WebKit.WebInspector
14import Graphics.UI.Gtk.WebKit.WebInspector
15import Data.List
15import Data.List
16−import Data.String
17import System.Directory
16import System.Directory
18
17
19makeDefaultWebView :: String -> (WebView -> IO ()) -> IO ()
18makeDefaultWebView :: String -> (WebView -> IO ()) -> IO ()
@@ -39,7 +38,7 @@ makeDefaultWebView userAgentKey main = do
39 _ <- webView `on` loadFinished $ \_ -> do
38 _ <- webView `on` loadFinished $ \_ -> do
40 main webView --TODO: Should probably only do this once
39 main webView --TODO: Should probably only do this once
41 inspector <- webViewGetInspector webView
40 inspector <- webViewGetInspector webView
42− _ <- inspector `on` inspectWebView $ \wv -> do
41+ _ <- inspector `on` inspectWebView $ \_ -> do
43 inspectorWindow <- windowNew
42 inspectorWindow <- windowNew
44 windowSetDefaultSize inspectorWindow 900 600
43 windowSetDefaultSize inspectorWindow 900 600
45 inspectorScrollWin <- scrolledWindowNew Nothing Nothing
44 inspectorScrollWin <- scrolledWindowNew Nothing Nothing
src/Reflex/Dom/Widget/Basic.hs+8−11
@@ -127,8 +127,9 @@ widgetHold child0 newChild = do
127widgetHoldInternal :: MonadWidget t m => m a -> Event t (m b) -> m (a, Event t b)
127widgetHoldInternal :: MonadWidget t m => m a -> Event t (m b) -> m (a, Event t b)
128widgetHoldInternal child0 newChild = do
128widgetHoldInternal child0 newChild = do
129 startPlaceholder <- text' ""
129 startPlaceholder <- text' ""
130− p <- askParent
130+ (result0, childVoidAction0) <- do
131+ p <- askParent
131− (result0, childVoidAction0) <- subWidgetWithVoidActions p child0
132+ subWidgetWithVoidActions p child0
132 endPlaceholder <- text' ""
133 endPlaceholder <- text' ""
133 (newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
134 (newChildBuilt, newChildBuiltTriggerRef) <- newEventWithTriggerRef
134 performEvent_ $ fmap (const $ return ()) newChildBuilt --TODO: Get rid of this hack
135 performEvent_ $ fmap (const $ return ()) newChildBuilt --TODO: Get rid of this hack
@@ -141,12 +142,8 @@ widgetHoldInternal child0 newChild = do
141 (result, postBuild, voidActions) <- runWidget df c
142 (result, postBuild, voidActions) <- runWidget df c
142 runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
143 runFrameWithTriggerRef newChildBuiltTriggerRef (result, voidActions)
143 postBuild
144 postBuild
144− mp <- liftIO $ nodeGetParentNode endPlaceholder
145+ 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)
146+ forM_ mp' $ \p' -> liftIO $ nodeInsertBefore p' (Just df) (Just endPlaceholder)
149− return ()
150 return ()
147 return ()
151 addVoidAction $ ffor newChild $ \c -> do
148 addVoidAction $ ffor newChild $ \c -> do
152 liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
149 liftIO $ deleteBetweenExclusive startPlaceholder endPlaceholder
@@ -156,7 +153,7 @@ widgetHoldInternal child0 newChild = do
156diffMapNoEq :: (Ord k) => Map k v -> Map k v -> Map k (Maybe v)
153diffMapNoEq :: (Ord k) => Map k v -> Map k v -> Map k (Maybe v)
157diffMapNoEq olds news = flip Map.mapMaybe (align olds news) $ \case
154diffMapNoEq olds news = flip Map.mapMaybe (align olds news) $ \case
158 This _ -> Just Nothing
155 This _ -> Just Nothing
159− These old new -> Just $ Just new
156+ These _ new -> Just $ Just new
160 That new -> Just $ Just new
157 That new -> Just $ Just new
161
158
162applyMap :: Ord k => Map k v -> Map k (Maybe v) -> Map k v
159applyMap :: 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
187listWithKeyShallowDiff initialVals valsChanged mkChild = do
184listWithKeyShallowDiff initialVals valsChanged mkChild = do
188 let childValChangedSelector = fanMap $ fmap (Map.mapMaybe id) valsChanged
185 let childValChangedSelector = fanMap $ fmap (Map.mapMaybe id) valsChanged
189 sentVals <- foldDyn (flip applyMap) Map.empty $ fmap (fmap (fmap (\_ -> ()))) valsChanged
186 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
191 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
188 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
192 Just _ -> Nothing -- We don't want to let spurious re-creations of items through
189 Just _ -> Nothing -- We don't want to let spurious re-creations of items through
193 listHoldWithKey initialVals (attachWith (flip (Map.differenceWith relevantDiff)) (current sentVals) valsChanged) $ \k v ->
190 listHoldWithKey initialVals (attachWith (flip (Map.differenceWith relevantDiff)) (current sentVals) valsChanged) $ \k v ->
@@ -669,7 +666,7 @@ class HasDomEvent t a | a -> t where
669 domEvent :: EventName en -> a -> Event t (EventResultType en)
666 domEvent :: EventName en -> a -> Event t (EventResultType en)
670
667
671instance Reflex t => HasDomEvent t (El t) where
668instance 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)
673
670
674linkClass :: MonadWidget t m => String -> String -> m (Link t)
671linkClass :: MonadWidget t m => String -> String -> m (Link t)
675linkClass s c = do
672linkClass s c = do
src/Reflex/Dom/Widget/Input.hs−1
@@ -13,7 +13,6 @@ import GHCJS.DOM.HTMLTextAreaElement
13import GHCJS.DOM.Element
13import GHCJS.DOM.Element
14import GHCJS.DOM.HTMLSelectElement
14import GHCJS.DOM.HTMLSelectElement
15import GHCJS.DOM.EventM
15import GHCJS.DOM.EventM
16−import GHCJS.DOM.UIEvent
17import GHCJS.DOM.File
16import GHCJS.DOM.File
18import GHCJS.DOM.FileList
17import GHCJS.DOM.FileList
19import Data.Monoid
18import Data.Monoid