hlint-1.9.20: Source code suggestions

Safe HaskellNone
LanguageHaskell98

Language.Haskell.HLint

Description

WARNING: This module represents the old version of the HLint API. It will be deleted in favour of Language.Haskell.HLint3 in the next major version.

This module provides a library interface to HLint, strongly modelled on the command line interface.

Synopsis

Documentation

hlint :: [String] -> IO [Suggestion] Source

This function takes a list of command line arguments, and returns the given suggestions. To see a list of arguments type hlint --help at the console. This function writes to the stdout/stderr streams, unless --quiet is specified.

As an example:

do hints <- hlint ["src", "--ignore=Use map","--quiet"]
   when (length hints > 3) $ error "Too many hints!"

data Suggestion Source

A suggestion - the Show instance is of particular use.

suggestionLocation :: Suggestion -> SrcLoc Source

From a suggestion, extract the file location it refers to.

suggestionSeverity :: Suggestion -> Severity Source

From a suggestion, determine how severe it is.

data Severity Source

How severe an issue is.

Constructors

Ignore

The issue has been explicitly ignored and will usually be hidden (pass --show on the command line to see ignored ideas).

Warning

Warnings are things that some people may consider improvements, but some may not.

Error

Errors are suggestions that are nearly always a good idea to apply.