on develop help sign in
HLint suggestions
commit01787dee49aaaef1b4376b245fc6e4890325d812 authorTom Smalley <tfsmalley@gmail.com> dateTue 18 Dec 2018, 18:18 (8 years ago) parentd7f72a1
3 files changed+11−12
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+5−4 reflex-dom-core/src/Reflex/Dom/Prerender.hs−3 reflex-dom-core/test/hydration.hs+6−5
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+5−4
@@ -16,6 +16,7 @@
1616{-# LANGUAGE RankNTypes #-}
1717{-# LANGUAGE RecursiveDo #-}
1818{-# LANGUAGE ScopedTypeVariables #-}
19+{-# LANGUAGE TupleSections #-}
1920{-# LANGUAGE TypeFamilies #-}
2021{-# LANGUAGE TypeOperators #-}
2122{-# LANGUAGE UndecidableInstances #-}
@@ -852,7 +853,7 @@ instance (SupportsHydrationDomBuilder t m) => DomBuilder t (HydrationDomBuilderT
852853 , valueChangedByUI
853854 ]
854855
855− return $ flip (,) result $ SelectElement
856+ return $ (,result) $ SelectElement
856857 { _selectElement_value = v
857858 , _selectElement_change = valueChangedByUI
858859 , _selectElement_hasFocus = hasFocus
@@ -1253,7 +1254,7 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
12531254 let activate i = do
12541255 append $ toNode $ _traverseChildImmediate_fragment i
12551256 pure $ _traverseChildImmediate_placeholder i
1256− phs <- traverse id $ weakenDMapWith ((either (error "delayed") activate) . _traverseChild_mode . getCompose) children0
1257+ phs <- traverse id $ weakenDMapWith (either (error "impossible") activate . _traverseChild_mode . getCompose) children0
12571258 liftIO $ writeIORef placeholders $! phs
12581259 append $ toNode lastPlaceholder
12591260 requestDomAction_ $ ffor children' $ \p -> do
@@ -1361,7 +1362,7 @@ hoistTraverseIntMapWithKeyWithAdjust base updateChildUnreadiness applyDomUpdate_
13611362 let activate i = do
13621363 append $ toNode $ _traverseChildImmediate_fragment i
13631364 pure $ _traverseChildImmediate_placeholder i
1364− phs <- traverse ((either (error "delayed") activate) . _traverseChild_mode) children0
1365+ phs <- traverse (either (error "impossible") activate . _traverseChild_mode) children0
13651366 liftIO $ writeIORef placeholders $! phs
13661367 append $ toNode lastPlaceholder
13671368 requestDomAction_ $ ffor children' $ \p -> do
@@ -1371,7 +1372,7 @@ hoistTraverseIntMapWithKeyWithAdjust base updateChildUnreadiness applyDomUpdate_
13711372 liftIO $ writeIORef pendingChange (newUnready, newP)
13721373 when (IntMap.null newUnready) $ do
13731374 applyDomUpdate newP
1374− let result0 = IntMap.map (_traverseChild_result) children0
1375+ let result0 = IntMap.map _traverseChild_result children0
13751376 result' = ffor children' $ fmap $ _traverseChild_result
13761377 return (result0, result')
13771378
reflex-dom-core/src/Reflex/Dom/Prerender.hs−3
@@ -1,6 +1,4 @@
11{-# LANGUAGE ConstraintKinds #-}
2−{-# LANGUAGE DefaultSignatures #-}
3−{-# LANGUAGE EmptyDataDecls #-}
42{-# LANGUAGE FlexibleContexts #-}
53{-# LANGUAGE FlexibleInstances #-}
64{-# LANGUAGE FunctionalDependencies #-}
@@ -9,7 +7,6 @@
97{-# LANGUAGE MultiParamTypeClasses #-}
108{-# LANGUAGE Rank2Types #-}
119{-# LANGUAGE ScopedTypeVariables #-}
12−{-# LANGUAGE TypeApplications #-}
1310{-# LANGUAGE TypeFamilies #-}
1411{-# LANGUAGE TypeSynonymInstances #-}
1512{-# LANGUAGE UndecidableInstances #-}
reflex-dom-core/test/hydration.hs+6−5
@@ -13,6 +13,7 @@
1313{-# LANGUAGE RecursiveDo #-}
1414{-# LANGUAGE ScopedTypeVariables #-}
1515{-# LANGUAGE TemplateHaskell #-}
16+{-# LANGUAGE TupleSections #-}
1617{-# LANGUAGE TypeApplications #-}
1718{-# LANGUAGE TypeFamilies #-}
1819
@@ -133,7 +134,7 @@ main = withSeleniumServer $ \selenium -> do
133134
134135tests :: WD.WDConfig -> [Capabilities] -> Selenium -> Spec
135136tests wdConfig caps _selenium = do
136− let session' = sessionWith wdConfig "" . using (map (flip (,) "") caps)
137+ let session' = sessionWith wdConfig "" . using (map (,"") caps)
137138 runWD = runWDOptions (WdOptions False)
138139 describe "text" $ session' $ do
139140 it "works" $ runWD $ do
@@ -218,7 +219,7 @@ tests wdConfig caps _selenium = do
218219 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
219220 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
220221 & initialAttributes .~ "id" =: "second"
221− & elementConfig_eventSpec .~ (addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def)
222+ & elementConfig_eventSpec .~ addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def
222223 void $ element "span" conf $ text "hello world"
223224 performEvent_ $ liftIO (writeRef secondClickedRef True) <$ domEvent Click secondDivEl
224225 firstClicked <- readRef firstClickedRef
@@ -234,7 +235,7 @@ tests wdConfig caps _selenium = do
234235 clicked <- testWidget (pure ()) click $ prerender_ (pure ()) $ do
235236 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
236237 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
237− & elementConfig_eventSpec .~ (addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> preventDefault) def)
238+ & elementConfig_eventSpec .~ addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> preventDefault) def
238239 & initialAttributes .~ "type" =: "checkbox"
239240 void $ element "input" conf $ text "hello world"
240241 assertEqual "Click not prevented" (False, False) clicked
@@ -340,8 +341,8 @@ tests wdConfig caps _selenium = do
340341 testWidget (pure ()) checkValue $ do
341342 update <- triggerEventWithChan setValueChan
342343 e <- inputElement $ def & inputElementConfig_setValue .~ update
343− performEvent_ $ liftIO . (writeRef valueByUIRef) <$> _inputElement_input e
344− performEvent_ $ liftIO . (writeRef valueRef) <$> updated (value e)
344+ performEvent_ $ liftIO . writeRef valueByUIRef <$> _inputElement_input e
345+ performEvent_ $ liftIO . writeRef valueRef <$> updated (value e)
345346 it "sets checked appropriately" $ runWD $ do
346347 checkedByUIRef <- newRef False
347348 checkedRef <- newRef False