hlint-2.0.9: Source code suggestions

Safe Haskell | None
Language | Haskell2010

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

- hlint :: [String] -> IO [Suggestion]
- data Suggestion
- suggestionLocation :: Suggestion -> SrcLoc
- suggestionSeverity :: Suggestion -> Severity
- data Severity
  - = Ignore
  - | Suggestion
  - | 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 # |
Methods (==) :: Suggestion -> Suggestion -> Bool # (/=) :: Suggestion -> Suggestion -> Bool #
Ord Suggestion # |
Methods compare :: Suggestion -> Suggestion -> Ordering # (<) :: Suggestion -> Suggestion -> Bool # (<=) :: Suggestion -> Suggestion -> Bool # (>) :: Suggestion -> Suggestion -> Bool # (>=) :: Suggestion -> Suggestion -> Bool # max :: Suggestion -> Suggestion -> Suggestion # min :: Suggestion -> Suggestion -> Suggestion #
Show Suggestion # |
Methods showsPrec :: Int -> Suggestion -> ShowS # show :: Suggestion -> String # showList :: [Suggestion] -> ShowS #

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 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).
Suggestion | Suggestions are things that some people may consider improvements, but some may not.
Warning | Warnings are suggestions that are nearly always a good idea to apply.
Error | Available as a setting for the user.

Instances

Bounded Severity # |
Methods minBound :: Severity # maxBound :: Severity #
Enum Severity # |
Methods succ :: Severity -> Severity # pred :: Severity -> Severity # toEnum :: Int -> Severity # fromEnum :: Severity -> Int # enumFrom :: Severity -> [Severity] # enumFromThen :: Severity -> Severity -> [Severity] # enumFromTo :: Severity -> Severity -> [Severity] # enumFromThenTo :: Severity -> Severity -> Severity -> [Severity] #
Eq Severity # |
Methods (==) :: Severity -> Severity -> Bool # (/=) :: Severity -> Severity -> Bool #
Ord Severity # |
Methods compare :: Severity -> Severity -> Ordering # (<) :: Severity -> Severity -> Bool # (<=) :: Severity -> Severity -> Bool # (>) :: Severity -> Severity -> Bool # (>=) :: Severity -> Severity -> Bool # max :: Severity -> Severity -> Severity # min :: Severity -> Severity -> Severity #
Read Severity # |
Methods readsPrec :: Int -> ReadS Severity # readList :: ReadS [Severity] # readPrec :: ReadPrec Severity # readListPrec :: ReadPrec [Severity] #
Show Severity # |
Methods showsPrec :: Int -> Severity -> ShowS # show :: Severity -> String # showList :: [Severity] -> ShowS #