packages feed

hlint 1.8.12 → 1.8.13

raw patch · 6 files changed

+68/−12 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

data/Default.hs view
@@ -44,7 +44,7 @@ error = compare (f x) (f y) ==> Data.Ord.comparing f x y error = on compare f ==> Data.Ord.comparing f error = x == y || x == z ==> x `elem` [y,z]-error = x /= y || x /= z ==> x `notElem` [y,z]+error = x /= y && x /= z ==> x `notElem` [y,z]  -- READ/SHOW 
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.6 build-type:         Simple name:               hlint-version:            1.8.12+version:            1.8.13 -- license is GPL v2 only license:            GPL license-file:       LICENSE
src/HSE/All.hs view
@@ -16,6 +16,7 @@ import Data.List import Data.Maybe import Language.Preprocessor.Cpphs+import qualified Data.Map as Map   data ParseFlags = ParseFlags@@ -39,6 +40,9 @@ runCpp (Cpphs o) file x = runCpphs o file x  +---------------------------------------------------------------------+-- PARSING+ -- | Parse a Haskell module parseString :: ParseFlags -> FilePath -> String -> IO (String, ParseResult Module_) parseString flags file str = do@@ -54,15 +58,6 @@             }  --- resolve fixities later, so we don't ever get uncatchable ambiguity errors--- if there are fixity errors, just ignore them-applyFixity :: [Fixity] -> Module_ -> Module_-applyFixity fixity modu = descendBi f modu-    where-        f x = fromMaybe x $ applyFixities (extra ++ fixity) x :: Decl_-        extra = concatMap getFixity $ moduleDecls modu-- parseFile :: ParseFlags -> FilePath -> IO (String, ParseResult Module_) parseFile flags file = do     src <- readFileEncoding (encoding flags) file@@ -74,3 +69,41 @@ parseResult x = do     (_, res) <- x     return $! fromParseResult res+++---------------------------------------------------------------------+-- FIXITIES++-- resolve fixities later, so we don't ever get uncatchable ambiguity errors+-- if there are fixity errors, try the cheapFixities (which never fails)+applyFixity :: [Fixity] -> Module_ -> Module_+applyFixity base modu = descendBi f modu+    where+        f x = fromMaybe (cheapFixities fixs x) $ applyFixities fixs x :: Decl_+        fixs = concatMap getFixity (moduleDecls modu) ++ base+++-- Apply fixities, but ignoring any ambiguous fixity errors and skipping qualified names,+-- local infix declarations etc. Only use as a backup, if HSE gives an error.+--+-- Inspired by the code at:+-- http://hackage.haskell.org/trac/haskell-prime/attachment/wiki/FixityResolution/resolve.hs+cheapFixities :: [Fixity] -> Decl_ -> Decl_+cheapFixities fixs = descendBi (transform f)+    where+        ask = askFixity fixs+    +        f o@(InfixApp s1 (InfixApp s2 x op1 y) op2 z)+                | p1 == p2 && (a1 /= a2 || a1 == AssocNone) = o -- Ambiguous infix expression!+                | p1 > p2 || p1 == p2 && (a1 == AssocLeft || a2 == AssocNone) = o+                | otherwise = InfixApp s1 x op1 (f $ InfixApp s1 y op2 z)+            where+                (a1,p1) = ask op1+                (a2,p2) = ask op2+        f x = x+++askFixity :: [Fixity] -> QOp S -> (Assoc, Int)+askFixity xs = \k -> Map.findWithDefault (AssocLeft, 9) (fromNamed k) mp+    where+        mp = Map.fromList [(s,(a,p)) | Fixity a p x <- xs, let s = fromNamed x, s /= ""]
src/HSE/Match.hs view
@@ -5,6 +5,7 @@ import Data.Char import HSE.Type import HSE.Util+import qualified Language.Haskell.Exts as HSE_   class View a b where@@ -75,12 +76,28 @@     toNamed ":" = Special an $ Cons an     toNamed x = UnQual an $ toNamed x +instance Named HSE_.QName where+    fromNamed (HSE_.Special HSE_.Cons) = ":"+    fromNamed (HSE_.Special HSE_.UnitCon) = "()"+    fromNamed (HSE_.UnQual x) = fromNamed x+    fromNamed _ = ""++    toNamed ":" = HSE_.Special HSE_.Cons+    toNamed x = HSE_.UnQual $ toNamed x+ instance Named (Name S) where     fromNamed (Ident _ x) = x     fromNamed (Symbol _ x) = x      toNamed x | isSym x = Symbol an x               | otherwise = Ident an x++instance Named HSE_.Name where+    fromNamed (HSE_.Ident x) = x+    fromNamed (HSE_.Symbol x) = x++    toNamed x | isSym x = HSE_.Symbol x+              | otherwise = HSE_.Ident x  instance Named (ModuleName S) where     fromNamed (ModuleName _ x) = x
src/HSE/Type.hs view
@@ -1,7 +1,10 @@  module HSE.Type(module HSE.Type, module Export) where -import Language.Haskell.Exts.Annotated as Export hiding (parse, loc, parseFile, paren)+-- Almost all from the Annotated module, but the fixity resolution from Annotated+-- uses the unannotated Assoc enumeration, so export that instead+import Language.Haskell.Exts.Annotated as Export hiding (parse, loc, parseFile, paren, Assoc(..))+import Language.Haskell.Exts as Export(Assoc(..)) import Data.Generics.Uniplate.Data as Export  type S = SrcSpanInfo
src/Hint/Bracket.hs view
@@ -47,6 +47,9 @@ no = (f . g $ a) ++ e no = quickCheck ((\h -> cySucc h == succ h) :: Hygiene -> Bool) foo = (case x of y -> z; q -> w) :: Int++-- backup fixity resolution+main = do a += b . c; return $ a . b </TEST> -}