module Language.Haskell.HLint(hlint, Suggestion, suggestionLocation, suggestionSeverity, Severity(..)) where
import qualified HLint
import Config.Type
import Idea
import HSE.All
hlint :: [String] -> IO [Suggestion]
hlint :: [String] -> IO [Suggestion]
hlint = ([Idea] -> [Suggestion]) -> IO [Idea] -> IO [Suggestion]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Idea -> Suggestion) -> [Idea] -> [Suggestion]
forall a b. (a -> b) -> [a] -> [b]
map Idea -> Suggestion
Suggestion_) (IO [Idea] -> IO [Suggestion])
-> ([String] -> IO [Idea]) -> [String] -> IO [Suggestion]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [String] -> IO [Idea]
HLint.hlint
newtype Suggestion = Suggestion_ {Suggestion -> Idea
fromSuggestion :: Idea}
deriving (Suggestion -> Suggestion -> Bool
(Suggestion -> Suggestion -> Bool)
-> (Suggestion -> Suggestion -> Bool) -> Eq Suggestion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Suggestion -> Suggestion -> Bool
$c/= :: Suggestion -> Suggestion -> Bool
== :: Suggestion -> Suggestion -> Bool
$c== :: Suggestion -> Suggestion -> Bool
Eq,Eq Suggestion
Eq Suggestion =>
(Suggestion -> Suggestion -> Ordering)
-> (Suggestion -> Suggestion -> Bool)
-> (Suggestion -> Suggestion -> Bool)
-> (Suggestion -> Suggestion -> Bool)
-> (Suggestion -> Suggestion -> Bool)
-> (Suggestion -> Suggestion -> Suggestion)
-> (Suggestion -> Suggestion -> Suggestion)
-> Ord Suggestion
Suggestion -> Suggestion -> Bool
Suggestion -> Suggestion -> Ordering
Suggestion -> Suggestion -> Suggestion
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Suggestion -> Suggestion -> Suggestion
$cmin :: Suggestion -> Suggestion -> Suggestion
max :: Suggestion -> Suggestion -> Suggestion
$cmax :: Suggestion -> Suggestion -> Suggestion
>= :: Suggestion -> Suggestion -> Bool
$c>= :: Suggestion -> Suggestion -> Bool
> :: Suggestion -> Suggestion -> Bool
$c> :: Suggestion -> Suggestion -> Bool
<= :: Suggestion -> Suggestion -> Bool
$c<= :: Suggestion -> Suggestion -> Bool
< :: Suggestion -> Suggestion -> Bool
$c< :: Suggestion -> Suggestion -> Bool
compare :: Suggestion -> Suggestion -> Ordering
$ccompare :: Suggestion -> Suggestion -> Ordering
$cp1Ord :: Eq Suggestion
Ord)
instance Show Suggestion where
show :: Suggestion -> String
show = Idea -> String
forall a. Show a => a -> String
show (Idea -> String) -> (Suggestion -> Idea) -> Suggestion -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Suggestion -> Idea
fromSuggestion
suggestionLocation :: Suggestion -> SrcLoc
suggestionLocation :: Suggestion -> SrcLoc
suggestionLocation = SrcSpan -> SrcLoc
forall si. SrcInfo si => si -> SrcLoc
getPointLoc (SrcSpan -> SrcLoc)
-> (Suggestion -> SrcSpan) -> Suggestion -> SrcLoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Idea -> SrcSpan
ideaSpan (Idea -> SrcSpan) -> (Suggestion -> Idea) -> Suggestion -> SrcSpan
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Suggestion -> Idea
fromSuggestion
suggestionSeverity :: Suggestion -> Severity
suggestionSeverity :: Suggestion -> Severity
suggestionSeverity = Idea -> Severity
ideaSeverity (Idea -> Severity)
-> (Suggestion -> Idea) -> Suggestion -> Severity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Suggestion -> Idea
fromSuggestion