Skip to content

Commit

Permalink
Proposal for our own HLint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mgajda committed Nov 9, 2014
1 parent 5237ed1 commit 0059cdc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion HLint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ import "hint" HLint.Builtin.All

ignore "Eta reduce"

error = x `mappend` y `mappend` z ==> mconcat [x, y, z]
error "use mconcat" = x `mappend` y `mappend` z ==> mconcat [x, y, z]
warning "use concat" = x ++ y ++ z ==> concat [x, y, z]
warning "use fromMaybe" = \case {Nothing -> a; Just b -> b} ==> fromMaybe a
error "putEditorDynA works on any MonadEditor" = withEditor $ putEditorDynA a ==> putEditorDynA a
error "getEditorDynA works on any MonadEditor" = withEditor $ getEditorDynA a ==> getEditorDynA a
error "Why not use <$>?" = a >>= return . b ==> b <$> a
error "Why not use <$>?" = return . b =<< a ==> b <$> a

0 comments on commit 0059cdc

Please sign in to comment.