on develop help sign in
Fix hlint
59100d6Ryan Trinkle
examples/sortableList.hs+6−6
@@ -27,12 +27,12 @@ main = mainWidget $ do
27 values = zip3 (randoms (mkStdGen 0)) (randoms (mkStdGen 1)) (randoms (mkStdGen 2))
27 values = zip3 (randoms (mkStdGen 0)) (randoms (mkStdGen 1)) (randoms (mkStdGen 2))
28 testMap = Map.fromList $ zip keys values
28 testMap = Map.fromList $ zip keys values
29 resort <- leftmost <$> sequence
29 resort <- leftmost <$> sequence
30− [ fmap (comparing (view _1) <$) $ button "1 ASC"
30+ [ (comparing (view _1) <$) <$> button "1 ASC"
31− , fmap (flip (comparing (view _1)) <$) $ button "1 DESC"
31+ , (flip (comparing (view _1)) <$) <$> button "1 DESC"
32− , fmap (comparing (view _2) <$) $ button "2 ASC"
32+ , (comparing (view _2) <$) <$> button "2 ASC"
33− , fmap (flip (comparing (view _2)) <$) $ button "2 DESC"
33+ , (flip (comparing (view _2)) <$) <$> button "2 DESC"
34− , fmap (comparing (view _3) <$) $ button "3 ASC"
34+ , (comparing (view _3) <$) <$> button "3 ASC"
35− , fmap (flip (comparing (view _3)) <$) $ button "3 DESC"
35+ , (flip (comparing (view _3)) <$) <$> button "3 DESC"
36 ]
36 ]
37 simpleSortableList f testMap resort
37 simpleSortableList f testMap resort
38 return ()
38 return ()
src/Reflex/Dom/Builder/Immediate.hs+7−14
@@ -436,13 +436,7 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
436 return (result0, result')
436 return (result0, result')
437 traverseDMapWithKeyWithAdjust (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
437 traverseDMapWithKeyWithAdjust (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
438 initialEnv <- ImmediateDomBuilderT ask
438 initialEnv <- ImmediateDomBuilderT ask
439− let drawChildUpdate :: forall a. ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
440− drawChildUpdate child = do
441− Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
442− runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv
443− { _immediateDomBuilderEnv_parent = toNode df
444− }
445− (children0, children') <- lift $ traverseDMapWithKeyWithAdjust (\k v -> drawChildUpdate $ f k v) dm0 dm'
439+ (children0, children') <- lift $ traverseDMapWithKeyWithAdjust (\k v -> drawChildUpdate initialEnv $ f k v) dm0 dm'
446 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
440 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
447 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
441 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
448 result' = ffor children' $ mapPatchDMap $ \(Compose (_, _, r)) -> r
442 result' = ffor children' $ mapPatchDMap $ \(Compose (_, _, r)) -> r
@@ -462,13 +456,7 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
462 return (result0, result')
456 return (result0, result')
463 traverseDMapWithKeyWithAdjustWithMove (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
457 traverseDMapWithKeyWithAdjustWithMove (f :: forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) (dm0 :: DMap k v) dm' = do
464 initialEnv <- ImmediateDomBuilderT ask
458 initialEnv <- ImmediateDomBuilderT ask
465− let drawChildUpdate :: forall a. ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
466− drawChildUpdate child = do
467− Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
468− runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv
469− { _immediateDomBuilderEnv_parent = toNode df
470− }
471− (children0, children') <- lift $ traverseDMapWithKeyWithAdjustWithMove (\k v -> drawChildUpdate $ f k v) dm0 dm'
459+ (children0, children') <- lift $ traverseDMapWithKeyWithAdjustWithMove (\k v -> drawChildUpdate initialEnv $ f k v) dm0 dm'
472 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
460 let result0 = DMap.map (\(Compose (_, _, v)) -> v) children0
473 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
461 placeholders0 = weakenDMapWith (\(Compose (_, ph, _)) -> ph) children0
474 result' = ffor children' $ mapPatchDMapWithMove $ \(Compose (_, _, r)) -> r
462 result' = ffor children' $ mapPatchDMapWithMove $ \(Compose (_, _, r)) -> r
@@ -508,6 +496,11 @@ instance (Reflex t, MonadAdjust t m, MonadIO m, MonadHold t m, PerformEvent t m,
508 return ()
496 return ()
509 return (result0, result')
497 return (result0, result')
510
498
499+drawChildUpdate :: MonadIO m => ImmediateDomBuilderEnv t -> ImmediateDomBuilderT t m (v' a) -> m (Compose ((,,) DOM.DocumentFragment DOM.Text) v' a)
500+drawChildUpdate initialEnv child = do
501+ Just df <- createDocumentFragment $ _immediateDomBuilderEnv_document initialEnv
502+ runImmediateDomBuilderT (Compose <$> ((,,) <$> pure df <*> textNodeInternal ("" :: Text) <*> child)) $ initialEnv { _immediateDomBuilderEnv_parent = toNode df }
503+
511mkHasFocus :: (MonadHold t m, Reflex t) => Element er d t -> m (Dynamic t Bool)
504mkHasFocus :: (MonadHold t m, Reflex t) => Element er d t -> m (Dynamic t Bool)
512mkHasFocus e = do
505mkHasFocus e = do
513 let initialFocus = False --TODO: Actually get the initial focus of the element
506 let initialFocus = False --TODO: Actually get the initial focus of the element
test/hlint.hs+8
@@ -8,5 +8,13 @@ main = do
8 , "--ignore=Redundant do"
8 , "--ignore=Redundant do"
9 , "--ignore=Use camelCase"
9 , "--ignore=Use camelCase"
10 , "--ignore=Redundant $"
10 , "--ignore=Redundant $"
11+ , "--ignore=Use &&"
12+ , "--ignore=Use &&&"
13+ , "--ignore=Use const"
14+ , "--ignore=Use >=>"
15+ , "--ignore=Use ."
16+ , "--ignore=Use if"
17+ , "--ignore=Reduce duplication" --TODO: Re-enable this test
18+ , "--cpp-define=USE_TEMPLATE_HASKELL"
11 ]
19 ]
12 if null ideas then exitSuccess else exitFailure
20 if null ideas then exitSuccess else exitFailure