on develop help sign in
HLint suggestions
6253f19Tom Smalley
reflex-dom-core/reflex-dom-core.cabal+5−5
@@ -145,11 +145,11 @@ library
145 build-depends:
145 build-depends:
146 dependent-sum == 0.4.*
146 dependent-sum == 0.4.*
147
147
148−--test-suite hlint
148+test-suite hlint
149−-- build-depends: base, hlint
149+ build-depends: base, hlint
150−-- hs-source-dirs: test
150+ hs-source-dirs: test
151−-- main-is: hlint.hs
151+ main-is: hlint.hs
152−-- type: exitcode-stdio-1.0
152+ type: exitcode-stdio-1.0
153
153
154-- broken test on base 4.11 & ghc 8.4.3
154-- broken test on base 4.11 & ghc 8.4.3
155-- needs to be updated for changes in GHC.Stats
155-- needs to be updated for changes in GHC.Stats
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+4−12
@@ -2,12 +2,8 @@
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
3{-# LANGUAGE ConstraintKinds #-}
3{-# LANGUAGE ConstraintKinds #-}
4{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE DataKinds #-}
5−{-# LANGUAGE DefaultSignatures #-}
6−{-# LANGUAGE DeriveFoldable #-}
7{-# LANGUAGE DeriveFunctor #-}
5{-# LANGUAGE DeriveFunctor #-}
8−{-# LANGUAGE DeriveGeneric #-}
9{-# LANGUAGE DeriveTraversable #-}
6{-# LANGUAGE DeriveTraversable #-}
10−{-# LANGUAGE EmptyDataDecls #-}
11{-# LANGUAGE FlexibleContexts #-}
7{-# LANGUAGE FlexibleContexts #-}
12{-# LANGUAGE FlexibleInstances #-}
8{-# LANGUAGE FlexibleInstances #-}
13{-# LANGUAGE GADTs #-}
9{-# LANGUAGE GADTs #-}
@@ -19,10 +15,6 @@
19{-# LANGUAGE RankNTypes #-}
15{-# LANGUAGE RankNTypes #-}
20{-# LANGUAGE RecursiveDo #-}
16{-# LANGUAGE RecursiveDo #-}
21{-# LANGUAGE ScopedTypeVariables #-}
17{-# LANGUAGE ScopedTypeVariables #-}
22−{-# LANGUAGE StandaloneDeriving #-}
23−#ifdef USE_TEMPLATE_HASKELL
24−{-# LANGUAGE TemplateHaskell #-}
25−#endif
26{-# LANGUAGE TypeFamilies #-}
18{-# LANGUAGE TypeFamilies #-}
27{-# LANGUAGE TypeOperators #-}
19{-# LANGUAGE TypeOperators #-}
28{-# LANGUAGE UndecidableInstances #-}
20{-# LANGUAGE UndecidableInstances #-}
@@ -301,7 +293,7 @@ runHydrationDomBuilderT
301 -> HydrationDomBuilderEnv t
293 -> HydrationDomBuilderEnv t
302 -> Chan [DSum (EventTriggerRef t) TriggerInvocation]
294 -> Chan [DSum (EventTriggerRef t) TriggerInvocation]
303 -> m (a, HydrationRunnerT t m ())
295 -> m (a, HydrationRunnerT t m ())
304−runHydrationDomBuilderT (HydrationDomBuilderT a) env events = runDomRenderHookT (runStateT (runReaderT a env) (pure ())) events
296+runHydrationDomBuilderT (HydrationDomBuilderT a) env = runDomRenderHookT (runStateT (runReaderT a env) (pure ()))
305
297
306instance Monad m => HasDocument (HydrationDomBuilderT t m) where
298instance Monad m => HasDocument (HydrationDomBuilderT t m) where
307 {-# INLINABLE askDocument #-}
299 {-# INLINABLE askDocument #-}
@@ -507,9 +499,9 @@ makeElement elementTag cfg child = do
507 -- Run the cleanup, if we have it - but only when an exception is
499 -- Run the cleanup, if we have it - but only when an exception is
508 -- raised (we might get killed between acquiring the cleanup action
500 -- raised (we might get killed between acquiring the cleanup action
509 -- from 'triggerBody' and putting it in the MVar)
501 -- from 'triggerBody' and putting it in the MVar)
510− (\m -> m)
502+ id
511 -- Try to put this action into the cleanup MVar
503 -- Try to put this action into the cleanup MVar
512− (\m -> putMVar cleanup m)
504+ (putMVar cleanup)
513 pure $ do
505 pure $ do
514 tryReadMVar cleanup >>= \case
506 tryReadMVar cleanup >>= \case
515 Nothing -> killThread threadId
507 Nothing -> killThread threadId
@@ -1223,7 +1215,7 @@ hoistTraverseWithKeyWithAdjust base mapPatch updateChildUnreadiness applyDomUpda
1223 insertAfterPreviousNode ph
1215 insertAfterPreviousNode ph
1224 liftIO $ writeIORef lastPlaceholderRef ph
1216 liftIO $ writeIORef lastPlaceholderRef ph
1225 addHydrationStepWithSetup (accumMaybeB (flip apply) delayed0 delayed') $ \delayed -> do
1217 addHydrationStepWithSetup (accumMaybeB (flip apply) delayed0 delayed') $ \delayed -> do
1226− join $ sample (sequence . fmap (\(_ :=> Const d) -> d) . DMap.toList <$> delayed)
1218+ join $ sample (traverse (\(_ :=> Const d) -> d) . DMap.toList <$> delayed)
1227 setFinalPlaceholder
1219 setFinalPlaceholder
1228 liftIO $ writeIORef placeholders $! placeholders0
1220 liftIO $ writeIORef placeholders $! placeholders0
1229 getHydrationMode >>= \case
1221 getHydrationMode >>= \case