MarbleMice.com

Hacking the trees of knowledge.

HLint

without comments

A new version of the emacs mode for haskell an added feature to use HLint via the flymake mode. That sounded like a good thing to me even though I had never used HLint. I figured it is time to test it out, HLint that is.

Using cabal to install it on my vista machine it all went smoothly. Thus building my confidence in the idea of cabal.

Running HLint on a single file is as simple as hlint myfile.hs and it spit out a few errors and a few warnings. Most of the warning where excess brackets. The errors were things that I would not consider errors but useful none the less. It spotted cases where I could be using functions in the prelude rather creating my own. It also spotted some things that were overly complex due to my lack of understanding of haskell code. Overall it was a useful experience.

HLint certainly is a tool you should investigate sooner rather than later when learning haskell. It seems to be helping me to write more idiomatic haskell code. This really contrasts with Lint for C/C++ where you can spend considerable time understanding the warnings/errors and is not something I recommend for people writing throw away code while learning C/C++.

All I have to do now it hook it up to the flymake mode.

Written by birdle

December 3rd, 2009 at 10:40 pm

Posted in General

Tagged with

Leave a Reply