rlopez1j / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

Hlintify XMonad & XMonadContrib #373

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hlint (http://community.haskell.org/~ndm/hlint/) is a code-style tool that
flags verbose, useless, or otherwise bad bits of code. It would be good if
XMC had clean code. (Hlint strives for 'correctness'; none of the changes
ought to affect the semantics of the code.)

XMonad-core generates roughly 31 suggestions and XMC roughly 468. Even
excluding debatable suggestions like eta-reduction, this is a lot of small
bad things. Fortunately, they are all generally very easy to fix and
understand why the code was flagged, making this a good beginner project.

Attached are the 2 HTML reports hlint generates (obviously 31+468 messages
is a bit much to paste in).

Original issue reported on code.google.com by gwe...@gmail.com on 13 Feb 2010 at 11:45

Attachments:

GoogleCodeExporter commented 8 years ago
I like to think of hlint as -Wall on steroids, if that metaphor helps anyone.

Original comment by gwe...@gmail.com on 13 Feb 2010 at 11:46

GoogleCodeExporter commented 8 years ago
I've patched a few of the Hlint flags in xmonad core.
It is indeed a nice beginner project, I learned a lot.
I left one of the eta reduction warnings in there due to readability and I 
didn't alter the naming of the atoms to camelCase due to their origin.

When applying another eta reduction, I noticed the redundant use was a solution 
for the monomorphism restriction. This was changed by using scoped type 
variables also due to the possibility that generalisation isn't done in nested 
expressions (http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7). 

Any comments on my patch are welcome.

Original comment by wil...@willem.vanlint.name on 10 Aug 2011 at 9:49

Attachments: