on develop help sign in
HLint suggestions
01787deTom Smalley
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+5−4
@@ -16,6 +16,7 @@
16{-# LANGUAGE RankNTypes #-}
16{-# LANGUAGE RankNTypes #-}
17{-# LANGUAGE RecursiveDo #-}
17{-# LANGUAGE RecursiveDo #-}
18{-# LANGUAGE ScopedTypeVariables #-}
18{-# LANGUAGE ScopedTypeVariables #-}
19+{-# LANGUAGE TupleSections #-}
19{-# LANGUAGE TypeFamilies #-}
20{-# LANGUAGE TypeFamilies #-}
20{-# LANGUAGE TypeOperators #-}
21{-# LANGUAGE TypeOperators #-}
21{-# LANGUAGE UndecidableInstances #-}
22{-# LANGUAGE UndecidableInstances #-}
@@ -852,7 +853,7 @@ instance (SupportsHydrationDomBuilder t m) => DomBuilder t (HydrationDomBuilderT
852 , valueChangedByUI
853 , valueChangedByUI
853 ]
854 ]
854
855
855− return $ flip (,) result $ SelectElement
856+ return $ (,result) $ SelectElement
856 { _selectElement_value = v
857 { _selectElement_value = v
857 , _selectElement_change = valueChangedByUI
858 , _selectElement_change = valueChangedByUI
858 , _selectElement_hasFocus = hasFocus
859 , _selectElement_hasFocus = hasFocus
@@ -1253,7 +1254,7 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
1253 let activate i = do
1254 let activate i = do
1254 append $ toNode $ _traverseChildImmediate_fragment i
1255 append $ toNode $ _traverseChildImmediate_fragment i
1255 pure $ _traverseChildImmediate_placeholder i
1256 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
1257 liftIO $ writeIORef placeholders $! phs
1258 liftIO $ writeIORef placeholders $! phs
1258 append $ toNode lastPlaceholder
1259 append $ toNode lastPlaceholder
1259 requestDomAction_ $ ffor children' $ \p -> do
1260 requestDomAction_ $ ffor children' $ \p -> do
@@ -1361,7 +1362,7 @@ hoistTraverseIntMapWithKeyWithAdjust base updateChildUnreadiness applyDomUpdate_
1361 let activate i = do
1362 let activate i = do
1362 append $ toNode $ _traverseChildImmediate_fragment i
1363 append $ toNode $ _traverseChildImmediate_fragment i
1363 pure $ _traverseChildImmediate_placeholder i
1364 pure $ _traverseChildImmediate_placeholder i
1364− phs <- traverse ((either (error "delayed") activate) . _traverseChild_mode) children0
1365+ phs <- traverse (either (error "impossible") activate . _traverseChild_mode) children0
1365 liftIO $ writeIORef placeholders $! phs
1366 liftIO $ writeIORef placeholders $! phs
1366 append $ toNode lastPlaceholder
1367 append $ toNode lastPlaceholder
1367 requestDomAction_ $ ffor children' $ \p -> do
1368 requestDomAction_ $ ffor children' $ \p -> do
@@ -1371,7 +1372,7 @@ hoistTraverseIntMapWithKeyWithAdjust base updateChildUnreadiness applyDomUpdate_
1371 liftIO $ writeIORef pendingChange (newUnready, newP)
1372 liftIO $ writeIORef pendingChange (newUnready, newP)
1372 when (IntMap.null newUnready) $ do
1373 when (IntMap.null newUnready) $ do
1373 applyDomUpdate newP
1374 applyDomUpdate newP
1374− let result0 = IntMap.map (_traverseChild_result) children0
1375+ let result0 = IntMap.map _traverseChild_result children0
1375 result' = ffor children' $ fmap $ _traverseChild_result
1376 result' = ffor children' $ fmap $ _traverseChild_result
1376 return (result0, result')
1377 return (result0, result')
1377
1378
reflex-dom-core/src/Reflex/Dom/Prerender.hs−3
@@ -1,6 +1,4 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2−{-# LANGUAGE DefaultSignatures #-}
3−{-# LANGUAGE EmptyDataDecls #-}
4{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
5{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
@@ -9,7 +7,6 @@
9{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE MultiParamTypeClasses #-}
10{-# LANGUAGE Rank2Types #-}
8{-# LANGUAGE Rank2Types #-}
11{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
12−{-# LANGUAGE TypeApplications #-}
13{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeFamilies #-}
14{-# LANGUAGE TypeSynonymInstances #-}
11{-# LANGUAGE TypeSynonymInstances #-}
15{-# LANGUAGE UndecidableInstances #-}
12{-# LANGUAGE UndecidableInstances #-}
reflex-dom-core/test/hydration.hs+6−5
@@ -13,6 +13,7 @@
13{-# LANGUAGE RecursiveDo #-}
13{-# LANGUAGE RecursiveDo #-}
14{-# LANGUAGE ScopedTypeVariables #-}
14{-# LANGUAGE ScopedTypeVariables #-}
15{-# LANGUAGE TemplateHaskell #-}
15{-# LANGUAGE TemplateHaskell #-}
16+{-# LANGUAGE TupleSections #-}
16{-# LANGUAGE TypeApplications #-}
17{-# LANGUAGE TypeApplications #-}
17{-# LANGUAGE TypeFamilies #-}
18{-# LANGUAGE TypeFamilies #-}
18
19
@@ -133,7 +134,7 @@ main = withSeleniumServer $ \selenium -> do
133
134
134tests :: WD.WDConfig -> [Capabilities] -> Selenium -> Spec
135tests :: WD.WDConfig -> [Capabilities] -> Selenium -> Spec
135tests wdConfig caps _selenium = do
136tests wdConfig caps _selenium = do
136− let session' = sessionWith wdConfig "" . using (map (flip (,) "") caps)
137+ let session' = sessionWith wdConfig "" . using (map (,"") caps)
137 runWD = runWDOptions (WdOptions False)
138 runWD = runWDOptions (WdOptions False)
138 describe "text" $ session' $ do
139 describe "text" $ session' $ do
139 it "works" $ runWD $ do
140 it "works" $ runWD $ do
@@ -218,7 +219,7 @@ tests wdConfig caps _selenium = do
218 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
219 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
219 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
220 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
220 & initialAttributes .~ "id" =: "second"
221 & initialAttributes .~ "id" =: "second"
221− & elementConfig_eventSpec .~ (addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def)
222+ & elementConfig_eventSpec .~ addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def
222 void $ element "span" conf $ text "hello world"
223 void $ element "span" conf $ text "hello world"
223 performEvent_ $ liftIO (writeRef secondClickedRef True) <$ domEvent Click secondDivEl
224 performEvent_ $ liftIO (writeRef secondClickedRef True) <$ domEvent Click secondDivEl
224 firstClicked <- readRef firstClickedRef
225 firstClicked <- readRef firstClickedRef
@@ -234,7 +235,7 @@ tests wdConfig caps _selenium = do
234 clicked <- testWidget (pure ()) click $ prerender_ (pure ()) $ do
235 clicked <- testWidget (pure ()) click $ prerender_ (pure ()) $ do
235 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
236 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
236 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
237 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
238 & initialAttributes .~ "type" =: "checkbox"
239 & initialAttributes .~ "type" =: "checkbox"
239 void $ element "input" conf $ text "hello world"
240 void $ element "input" conf $ text "hello world"
240 assertEqual "Click not prevented" (False, False) clicked
241 assertEqual "Click not prevented" (False, False) clicked
@@ -340,8 +341,8 @@ tests wdConfig caps _selenium = do
340 testWidget (pure ()) checkValue $ do
341 testWidget (pure ()) checkValue $ do
341 update <- triggerEventWithChan setValueChan
342 update <- triggerEventWithChan setValueChan
342 e <- inputElement $ def & inputElementConfig_setValue .~ update
343 e <- inputElement $ def & inputElementConfig_setValue .~ update
343− performEvent_ $ liftIO . (writeRef valueByUIRef) <$> _inputElement_input e
344+ performEvent_ $ liftIO . writeRef valueByUIRef <$> _inputElement_input e
344− performEvent_ $ liftIO . (writeRef valueRef) <$> updated (value e)
345+ performEvent_ $ liftIO . writeRef valueRef <$> updated (value e)
345 it "sets checked appropriately" $ runWD $ do
346 it "sets checked appropriately" $ runWD $ do
346 checkedByUIRef <- newRef False
347 checkedByUIRef <- newRef False
347 checkedRef <- newRef False
348 checkedRef <- newRef False