hlint-1.8.29: Source code suggestions

Safe Haskell | None

Language.Haskell.HLint

Description

This module provides a library interface to HLint. The current interface is strongly modelled on the command line interface, and is expected to evolve.

Synopsis

- hlint :: [String] -> IO [Suggestion]
- data Suggestion
- suggestionLocation :: Suggestion -> SrcLoc
- suggestionSeverity :: Suggestion -> Severity
- data Severity
  - = Ignore
  - | Warning
  - | Error

# Documentation

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

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

A suggestion - the `Show` instance is of particular use.

Instances

Eq Suggestion |
Ord Suggestion |
Show Suggestion |

suggestionLocation :: Suggestion -> SrcLoc

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

suggestionSeverity :: Suggestion -> Severity

From a suggestion, determine how severe it is.

data Severity

How severe an error is.

Constructors

Ignore | Ignored errors are only returned when `--show` is passed.
Warning | Warnings are things that some people may consider improvements, but some may not.
Error | Errors are suggestions that should nearly always be a good idea to apply.

Instances

Bounded Severity |
Enum Severity |
Eq Severity |
Ord Severity |
Read Severity |
Show Severity |