packages feed

apply-refact (empty) → 0.1.0.0

raw patch · 1294 files changed

+2994/−0 lines, 1294 filesdep +basedep +containersdep +directorysetup-changed

Dependencies added: base, containers, directory, filemanip, filepath, ghc, ghc-exactprint, mtl, optparse-applicative, process, refact, silently, syb, tasty, tasty-expected-failure, tasty-golden, temporary-rc, transformers, unix-compat

Files

+ CHANGELOG view
@@ -0,0 +1,3 @@+v0.1++  * Initial Release
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2015, Matthew Pickering++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Matthew Pickering nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,77 @@+`apply-refact` applies refactorings specified by the+[`refact`](https://hackage.haskell.org/package/refact) package. It is currently+integrated into `hlint` to enable the automatic application of suggestions.++# Example Usage++<img src="http://i.imgur.com/7YXoVft.gif">++```+# test.hs++foo = (x)++# hlint.refact -- produced by hlint+[("test.hs:1:7: Warning: Redundant bracket\nFound:\n  (x)\nWhy not:\n+x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine+= 1, endCol = 10}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine =+1, endCol = 9})], orig = "x"}])]++> refactor test.hs --refact-file hlint.refact+foo = x+```++One of either the input file or `--refact-file` must be specified on the command+line. If an input file is specified but not `--refact-file` then `refactor` will+accept refactorings from stdin and vice versa.++The `-i` option can be specified to perform the refactoring inplace overwriting+the input file. This option is ignored when input is read from stdin.++The `-s` option can be specified to perform a stepwise evaluation of the refact+file. The user is prompted whether to perform each hint before it is performed.++The `--pos` option is intended to be used by tooling in order to specify which+specific hint should be performed.++## Refact Files++Refact files should be the result of `show` on a value of type `[(String,+[Refactoring SrcSpan])]`. The string is a description of the refactoring, one+description can have many associated refactoring steps.+++## Library Structure++The executable is provide so that libraries can use `apply-refact` without depending on the package.+The implementation relies on `ghc-exactprint` which depends itself on GHC. A+transitive dependancy that most developers wish to avoid!+++# Reporting Bugs++If the program produces a syntactically incorrect result then this is a bug.+Please open an issue on the issue tracker with precise instructions about how to+reproduce it.++1. The input file+2. The refact file+3. The command used to invoke `refactor`++There are some known problems with CPP processing. If your library contains CPP+directives other than `#ifdef` it is quite likely that the result will be+unexpected.++# Debugging++There are also two hidden flags which can be useful for debugging.++#### `--debug`++Outputs the GHC AST.++#### `--roundtrip`++Performs no refactoring operations on the file but is useful to test whether+unexpected formatting is due to `ghc-exactprint` or the refactoring.+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ apply-refact.cabal view
@@ -0,0 +1,92 @@+-- Initial hlint-refactor.cabal generated by cabal init.  For further+-- documentation, see http://haskell.org/cabal/users-guide/++name:                apply-refact+version:             0.1.0.0+synopsis:            Perform refactorings specified by the refact library.+description:         Perform refactorings specified by the refact library.+license:             BSD3+license-file:        LICENSE+author:              Matthew Pickering+maintainer:          matthewtpickering@gmail.com+-- copyright:+category:            Development+build-type:          Simple+extra-source-files: CHANGELOG+                   , README.md+                   , tests/examples/*.hs+                   , tests/examples/*.hs.refact+                   , tests/examples/*.hs.expected+cabal-version:       >=1.10+tested-with:        GHC == 7.10.2+++source-repository head+  type:     git+  location: https://github.com/mpickering/apply-refact.git++library+  exposed-modules:   Refact.Utils+                   , Refact.Apply+                   , Refact.Fixity+  GHC-Options: -Wall+  build-depends: base >=4.7 && <4.9+               , refact >= 0.2+               , ghc-exactprint >= 0.5+               , ghc+               , containers+               , syb+               , mtl+               , process+               , directory+  hs-source-dirs:      src+  default-language:    Haskell2010++executable refactor+  main-is: Main.hs+  hs-source-dirs:      src+  default-language: Haskell2010+  ghc-options: -Wall -fno-warn-unused-do-bind+  build-depends: base >= 4.7 && < 4.9+               , refact >= 0.2+               , ghc-exactprint >= 0.4.1+               , ghc+               , containers+               , syb+               , mtl+               , process+               , directory+               , optparse-applicative+               , filemanip+               , unix-compat+               , filepath+               , temporary-rc+               , transformers++Test-Suite test+  type:                exitcode-stdio-1.0+  hs-source-dirs:      tests, src+  main-is:             Test.hs+  GHC-Options:         -threaded -main-is Test+  Default-language:    Haskell2010+  if impl (ghc < 7.10)+      buildable: False+  Build-depends:       tasty+                     , tasty-golden+                     , tasty-expected-failure+                     , base < 5+               , refact >= 0.2+               , ghc-exactprint >= 0.4.1+               , ghc+               , containers+               , syb+               , mtl+               , process+               , directory+               , optparse-applicative+               , filemanip+               , unix-compat+               , filepath+               , silently+               , temporary-rc+               , transformers
+ src/Main.hs view
@@ -0,0 +1,318 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE BangPatterns #-}+++{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE PartialTypeSignatures #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+module Main where++import Language.Haskell.GHC.ExactPrint+import Language.Haskell.GHC.ExactPrint.Print+import Language.Haskell.GHC.ExactPrint.Delta+import Language.Haskell.GHC.ExactPrint.Parsers (parseModuleWithOptions)+import Language.Haskell.GHC.ExactPrint.Types+import Language.Haskell.GHC.ExactPrint.Utils+++import qualified Refact.Types as R+import Refact.Types hiding (SrcSpan)+import Refact.Apply+import Refact.Fixity+import Refact.Utils (toGhcSrcSpan, Module)+import qualified SrcLoc as GHC++import Options.Applicative+import Data.Maybe+import Control.Monad.Trans.Maybe+import Data.List hiding (find)+import Data.Ord++import System.IO+import System.IO.Temp+import System.FilePath.Find+import System.Exit+import qualified System.PosixCompat.Files as F++import Control.Monad+import Control.Monad.State+import Control.Monad.Identity++import Paths_apply_refact+import Data.Version++import Debug.Trace++import SrcLoc+import Text.Read+import Data.Char++data Verbosity = Silent | Normal | Loud deriving (Eq, Show, Ord)++parseVerbosity :: Monad m => String -> m Verbosity+parseVerbosity s =+  return $ case s of+             "0" -> Silent+             "1" -> Normal+             "2" -> Loud+             _   -> Normal++parsePos :: Monad m => String -> m (Int, Int)+parsePos s =+  case span isDigit s of+    (line, ',':col) ->+      case (,) <$> readMaybe line <*> readMaybe col of+        Just l -> return l+        Nothing -> fail "Invalid input"+    _ -> fail "Invalid input"++data Target = StdIn | File FilePath++data Options = Options+  { optionsTarget   :: Maybe FilePath -- ^ Where to process hints+  , optionsRefactFile :: Maybe FilePath -- ^ The refactorings to process+  , optionsInplace  :: Bool+  , optionsOutput   :: Maybe FilePath -- ^ Whether to overwrite the file inplace+  , optionsVerbosity :: Verbosity+  , optionsStep :: Bool -- ^ Ask before applying each hint+  , optionsDebug :: Bool+  , optionsRoundtrip :: Bool+  , optionsVersion :: Bool+  , optionsPos     :: Maybe (Int, Int)+  }++options :: Parser Options+options =+  Options <$>+    optional (argument str (metavar "TARGET"))+    <*>+    option (Just <$> str)+      (long "refact-file"+      <> value Nothing+      <> help "A file which specifies which refactorings to perform")++    <*>+    switch (long "inplace"+           <> short 'i'+           <> help "Whether to overwrite the target inplace")+    <*>+    optional (strOption (long "output"+                        <> short 'o'+                        <> help "Name of the file to output to"+                        <> metavar "FILE"))+    <*>+    option (str >>= parseVerbosity)+           ( long "verbosity"+           <> short 'v'+           <> value Normal+           <> help "Specify verbosity, 0, 1 or 2. The default is 1 and 0 is silent.")+    <*>+    switch (short 's'+           <> long "step"+           <> help "Ask before applying each refactoring")+    <*>+    switch (long "debug"+           <> help "Output the GHC AST for debugging"+           <> internal)+    <*>+    switch (long "roundtrip"+           <> help "Run ghc-exactprint on the file"+           <> internal)+    <*>+    switch (long "version"+           <> help "Display version number")+    <*>+    option (Just <$> (str >>= parsePos))+           (long "pos"+           <> value Nothing+           <> metavar "<line>,<col>"+           <> help "Apply hints relevant to a specific position")+++optionsWithHelp :: ParserInfo Options+optionsWithHelp+  =+    info (helper <*> options)+          ( fullDesc+          <> progDesc "Automatically perform refactorings on haskell source files"+          <> header "refactor" )+++main :: IO ()+main = do+  o@Options{..} <- execParser optionsWithHelp+  when optionsVersion (putStr ("v" ++ showVersion version) >> exitSuccess)+  unless (isJust optionsTarget || isJust optionsRefactFile)+    (error "Must specify either the target file or the refact file")+  case optionsTarget of+    Nothing ->+      withSystemTempFile "stdin"  (\fp hin -> do+        getContents >>= hPutStrLn hin >> hClose hin+        runPipe o fp)+    Just target -> do+      targetStatus <- F.getFileStatus target+      if F.isDirectory targetStatus+        then findHsFiles target >>= mapM_ (runPipe o)+        else runPipe o target++-- Given base directory finds all haskell source files+findHsFiles :: FilePath -> IO [FilePath]+findHsFiles = find filterDirectory filterFilename++filterDirectory :: FindClause Bool+filterDirectory =+  p <$> fileName+  where+    p x+      | "." `isPrefixOf` x = False+      | otherwise = True++filterFilename :: FindClause Bool+filterFilename = do+  ext <- extension+  fname <- fileName+  return (ext == ".hs" && p fname)+  where+    p x+      | "Setup.hs" `isInfixOf` x = False+      | otherwise                 = True+++-- Pipe++refactOptions :: PrintOptions Identity String+refactOptions = stringOptions { epRigidity = RigidLayout }++rigidLayout :: DeltaOptions+rigidLayout = deltaOptions RigidLayout++runPipe :: Options -> FilePath  -> IO ()+runPipe Options{..} file = do+  let verb = optionsVerbosity+  when (verb == Loud) (traceM "Parsing module")+  (as, m) <- either (error . show) (uncurry applyFixities)+              <$> parseModuleWithOptions rigidLayout file+  when optionsDebug (putStrLn (showAnnData as 0 m))+  rawhints <- getHints optionsRefactFile+  when (verb == Loud) (traceM "Got raw hints")+  let inp :: [(String, [Refactoring R.SrcSpan])] = read rawhints+      n = length inp+  when (verb == Loud) (traceM $ "Read " ++ show n ++ " hints")+  let noOverlapInp = removeOverlap verb inp+      refacts = (fmap . fmap . fmap) (toGhcSrcSpan file) <$> noOverlapInp++      posFilter (_, rs) =+        case optionsPos of+          Nothing -> True+          Just p  -> any (flip spans p . pos) rs+      filtRefacts = filter posFilter refacts+++  when (verb >= Normal) (traceM $ "Applying " ++ show (length (concatMap snd filtRefacts)) ++ " hints")+  when (verb == Loud) (traceM $ show filtRefacts)+  -- need a check here to avoid overlap+  (ares, res) <- if optionsStep+                   then fromMaybe (as, m) <$> runMaybeT (refactoringLoop as m filtRefacts)+                   else return . flip evalState 0 $+                          foldM (uncurry runRefactoring) (as, m) (concatMap snd filtRefacts)+  when (optionsDebug) (putStrLn (showAnnData ares 0 res))+  let output = runIdentity $ exactPrintWithOptions refactOptions res ares+  if optionsInplace && isJust optionsTarget+    then writeFile file output+    else case optionsOutput of+           Nothing -> putStr output+           Just f  -> do+            when (verb == Loud) (traceM $ "Writing result to " ++ f)+            writeFile f output++-- Filters out overlapping ideas, picking the first idea in a set of overlapping ideas.+-- If two ideas start in the exact same place, pick the largest edit.+removeOverlap :: Verbosity -> [(String, [Refactoring R.SrcSpan])] -> [(String, [Refactoring R.SrcSpan])]+removeOverlap verb = dropOverlapping . sortBy f . summarize+  where+    -- We want to consider all Refactorings of a single idea as a unit, so compute a summary+    -- SrcSpan that encompasses all the Refactorings within each idea.+    summarize :: [(String, [Refactoring R.SrcSpan])] -> [(String, (R.SrcSpan, [Refactoring R.SrcSpan]))]+    summarize ideas = [ (s, (foldr1 summary (map pos rs), rs)) | (s, rs) <- ideas, not (null rs) ]++    summary (R.SrcSpan sl1 sc1 el1 ec1)+            (R.SrcSpan sl2 sc2 el2 ec2) =+      let (sl, sc) = case compare sl1 sl2 of+                      LT -> (sl1, sc1)+                      EQ -> (sl1, min sc1 sc2)+                      GT -> (sl2, sc2)+          (el, ec) = case compare el1 el2 of+                      LT -> (el2, ec2)+                      EQ -> (el2, max ec1 ec2)+                      GT -> (el1, ec1)+      in R.SrcSpan sl sc el ec++    -- Order by span start. If starting in same place, order by size.+    f (_,(s1,_)) (_,(s2,_)) =+      comparing startLine s1 s2 <> -- s1 first if it starts on earlier line+      comparing startCol s1 s2 <>  --             or on earlier column+      comparing endLine s2 s1 <>   -- they start in same place, s2 comes+      comparing endCol s2 s1       -- first if it ends later+      -- else, completely same span, so s1 will be first++    dropOverlapping [] = []+    dropOverlapping (p:ps) = go p ps+    go (s,(_,rs)) [] = [(s,rs)]+    go p@(s,(_,rs)) (x:xs)+      | p `overlaps` x = (if verb > Silent+                          then trace ("Ignoring " ++ show (snd (snd x)) ++ " due to overlap.")+                          else id) go p xs+      | otherwise = (s,rs) : go x xs+    -- for overlaps, we know s1 always starts <= s2, due to our sort+    overlaps (_,(s1,_)) (_,(s2,_)) =+      case compare (startLine s2) (endLine s1) of+        LT -> True+        EQ -> startCol s2 <= endCol s1+        GT -> False++data LoopOption = LoopOption+                    { desc :: String+                    , perform :: MaybeT IO (Anns, Module) }++refactoringLoop :: Anns -> Module -> [(String, [Refactoring GHC.SrcSpan])]+                -> MaybeT IO (Anns, Module)+refactoringLoop as m [] = return (as, m)+refactoringLoop as m ((_, []): rs) = refactoringLoop as m rs+refactoringLoop as m hints@((hintDesc, rs): rss) =+  do inp <- liftIO $ do+        putStrLn hintDesc+        putStrLn $ "Apply hint [" ++ intercalate ", " (map fst opts) ++ "]"+        -- In case that the input also comes from stdin+        withFile "/dev/tty" ReadMode hGetLine+     case lookup inp opts of+          Just opt   -> perform opt+          Nothing    -> loopHelp+  where+    opts =+      [ ("y", LoopOption "Apply current hint" yAction)+      , ("n", LoopOption "Don't apply the current hint" (refactoringLoop as m rss))+      , ("q", LoopOption "Apply no further hints" (return (as, m)))+      , ("d", LoopOption "Discard previous changes" mzero )+      , ("v", LoopOption "View current file" (liftIO (putStrLn (exactPrint m as))+                                              >> refactoringLoop as m hints))+      , ("?", LoopOption "Show this help menu" loopHelp)]+    loopHelp = do+            liftIO . putStrLn . unlines . map mkLine $ opts+            refactoringLoop as m hints+    mkLine (c, opt) = c ++ " - " ++ desc opt+    -- Force to force bottoms+    yAction =+      let (!r1, !r2) = flip evalState 0 $ foldM (uncurry runRefactoring) (as, m) rs+        in do+          exactPrint r2 r1 `seq` return ()+          refactoringLoop r1 r2 rss+++getHints :: Maybe FilePath -> IO String+getHints (Just hintFile) = readFile hintFile+getHints Nothing = getContents+
+ src/Refact/Apply.hs view
@@ -0,0 +1,277 @@+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+module Refact.Apply (runRefactoring)  where++import Language.Haskell.GHC.ExactPrint+import Language.Haskell.GHC.ExactPrint.Parsers+import Language.Haskell.GHC.ExactPrint.Annotate+import Language.Haskell.GHC.ExactPrint.Types+import Language.Haskell.GHC.ExactPrint.Utils++import Data.Data+import Data.Generics.Schemes++import HsExpr as GHC hiding (Stmt)+import qualified HsBinds as GHC+import qualified HsDecls as GHC+import HsImpExp+import qualified Module as GHC+import HsSyn hiding (Pat, Stmt)+import SrcLoc+import qualified SrcLoc as GHC+import qualified RdrName as GHC+import qualified OccName as GHC+import Data.Generics+import Control.Monad.State++import qualified Data.Map as Map++import System.IO.Unsafe++import Control.Arrow++import Data.Maybe++import Refact.Types hiding (SrcSpan)+import qualified Refact.Types as R+import Refact.Utils (Stmt, Pat, Name, Decl, M, Expr, Type+                    , modifyAnnKey, replaceAnnKey, Import)+++-- Perform the substitutions++getSeed :: State Int Int+getSeed = get <* modify (+1)++-- | Peform a @Refactoring@.+runRefactoring :: Data a => Anns -> a -> Refactoring GHC.SrcSpan -> State Int (Anns, a)+runRefactoring as m r@Replace{}  = do+  seed <- getSeed+  return $ case rtype r of+    Expr -> replaceWorker as m parseExpr seed r+    Decl -> replaceWorker as m parseDecl seed r+    Type -> replaceWorker as m parseType seed r+    Pattern -> replaceWorker as m parsePattern seed r+    Stmt -> replaceWorker as m parseStmt seed r+    Bind -> replaceWorker as m parseBind seed r+    R.Match ->  replaceWorker as m parseMatch seed r+    ModuleName -> replaceWorker as m (parseModuleName (pos r)) seed r+    Import -> replaceWorker as m parseImport seed r++runRefactoring as m ModifyComment{..} =+    return (Map.map go as, m)+    where+      go a@(Ann{ annPriorComments, annsDP }) =+        a { annsDP = map changeComment annsDP+          , annPriorComments = map (first change) annPriorComments }+      changeComment (AnnComment d, dp) = (AnnComment (change d), dp)+      changeComment e = e+      change old@Comment{..}= if ss2pos commentIdentifier == ss2pos pos+                                          then old { commentContents = newComment}+                                          else old+runRefactoring as m Delete{rtype, pos} = do+  let f = case rtype of+            Stmt -> doDeleteStmt ((/= pos) . getLoc)+            Import -> doDeleteImport ((/= pos) . getLoc)+            _ -> id+  return (as, f m)+  {-+runRefactoring as m Rename{nameSubts} = (as, m)+  --(as, doRename nameSubts m)+ -}+runRefactoring as m InsertComment{..} =+  let exprkey = mkAnnKey (findDecl m pos) in+  return (insertComment exprkey newComment as, m)+runRefactoring as m RemoveAsKeyword{..} =+  return (as, removeAsKeyword m)+  where+    removeAsKeyword = everywhere (mkT go)+    go :: LImportDecl GHC.RdrName -> LImportDecl GHC.RdrName+    go imp@(GHC.L l i)  | l == pos = GHC.L l (i { ideclAs = Nothing })+                    | otherwise =  imp++++parseModuleName :: GHC.SrcSpan -> Parser (GHC.Located GHC.ModuleName)+parseModuleName ss _ _ s =+  let newMN =  GHC.L ss (GHC.mkModuleName s)+      newAnns = relativiseApiAnns newMN (Map.empty, Map.empty)+  in return (newAnns, newMN)+parseBind :: Parser (GHC.LHsBind GHC.RdrName)+parseBind dyn fname s =+  case parseDecl dyn fname s of+    -- Safe as we add no annotations to the ValD+    Right (as, GHC.L l (GHC.ValD b)) -> Right (as, GHC.L l b)+    Right (_, GHC.L l _) -> Left (l, "Not a HsBind")+    Left e -> Left e+parseMatch :: Parser (GHC.LMatch GHC.RdrName (GHC.LHsExpr GHC.RdrName))+parseMatch dyn fname s =+  case parseBind dyn fname s of+    Right (as, GHC.L l GHC.FunBind{fun_matches}) ->+      case GHC.mg_alts fun_matches of+           [x] -> Right (as, x)+           _   -> Left (l, "Not a single match")+    Right (_, GHC.L l _) -> Left (l, "Not a funbind")+    Left e -> Left e++-- Substitute variables into templates++substTransform :: (Data a, Data b) => b -> [(String, GHC.SrcSpan)] -> a -> M a+substTransform m ss = everywhereM (mkM (exprSub m ss)+                                    `extM` typeSub m ss+                                    `extM` patSub m ss+                                    `extM` stmtSub m ss+                                    `extM` identSub m ss+                                    )++stmtSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Stmt -> M Stmt+stmtSub m subs old@(GHC.L _ (BodyStmt (GHC.L _ (HsVar name)) _ _ _) ) =+  resolveRdrName m (findStmt m) old subs name+stmtSub _ _ e = return e++patSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Pat -> M Pat+patSub m subs old@(GHC.L _ (VarPat name)) =+  resolveRdrName m (findPat m) old subs name+patSub _ _ e = return e++typeSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Type -> M Type+typeSub m subs old@(GHC.L _ (HsTyVar name)) =+  resolveRdrName m (findType m) old subs name+typeSub _ _ e = return e++exprSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Expr -> M Expr+exprSub m subs old@(GHC.L _ (HsVar name)) =+  resolveRdrName m (findExpr m) old subs name+exprSub _ _ e = return e++identSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Name -> M Name+identSub m subs old@(GHC.L _ name) =+  resolveRdrName' subst (findName m) old subs name+  where+    subst :: Name -> (Name, Pat) -> M Name+    subst (mkAnnKey -> oldkey) (n, p)+      = n <$ modify (\r -> replaceAnnKey r oldkey (mkAnnKey p) (mkAnnKey n) (mkAnnKey p))++resolveRdrName' ::+                  (a -> b -> M a)  -> (SrcSpan -> b) -> a+               -> [(String, GHC.SrcSpan)] -> GHC.RdrName -> M a+resolveRdrName' g f old subs name =+  case name of+    -- Todo: this should replace anns as well?+    GHC.Unqual (GHC.occNameString . GHC.occName -> oname)+      -> case lookup oname subs of+              Just (f -> new) -> g old new+              Nothing -> return old+    _ -> return old++resolveRdrName :: (Data old, Data a)+               => a+               -> (SrcSpan -> Located old)+               -> Located old+               -> [(String, SrcSpan)]+               -> GHC.RdrName+               -> M (Located old)+resolveRdrName m = resolveRdrName' (modifyAnnKey m)++insertComment :: AnnKey -> String+              -> Map.Map AnnKey Annotation+              -> Map.Map AnnKey Annotation+insertComment k s as =+  let comment = Comment s GHC.noSrcSpan Nothing in+  Map.adjust (\a@Ann{..} -> a { annPriorComments = annPriorComments ++ [(comment, DP (1,0))]+                          , annEntryDelta = DP (1,0) }) k as+++doGenReplacement :: (Data ast, Data a)+              => a+              -> (GHC.Located ast -> Bool)+              -> GHC.Located ast+              -> GHC.Located ast+              -> State (Anns, Bool) (GHC.Located ast)+doGenReplacement m p new old =+  if p old then do+                  s <- get+                  let (v, st) = runState (modifyAnnKey m old new) (fst s)+                  modify (const (st, True))+                  return v+           else return old++replaceWorker :: (Annotate a, Data mod) => Anns -> mod+              -> Parser (GHC.Located a) -> Int+              -> Refactoring GHC.SrcSpan -> (Anns, mod)+replaceWorker as m parser seed Replace{..} =+  let replExprLocation = pos+      uniqueName = "template" ++ show seed+      p s = unsafePerformIO (withDynFlags (\d -> parser d uniqueName s))+      (relat, template) = case p orig of+                              Right xs -> xs+                              Left err -> error (show err)+      (newExpr, newAnns) = runState (substTransform m subts template) (mergeAnns as relat)+      replacementPred (GHC.L l _) = l == replExprLocation+      transformation = everywhereM (mkM (doGenReplacement m replacementPred newExpr))+   in case runState (transformation m) (newAnns, False) of+        (finalM, (finalAs, True)) -> (finalAs, finalM)+        -- Failed to find a replacment so don't make any changes+        _ -> (as, m)+replaceWorker as m _ _ _  = (as, m)++++-- Find the largest expression with a given SrcSpan+findGen :: forall ast a . (Data ast, Data a) => String -> a -> SrcSpan -> GHC.Located ast+findGen s m ss = fromMaybe (error (s ++ " " ++ showGhc ss)) (doTrans m)+  where+    doTrans :: a -> Maybe (GHC.Located ast)+    doTrans = something (mkQ Nothing (findLargestExpression ss))++findExpr :: Data a => a -> SrcSpan -> Expr+findExpr = findGen "expr"++findPat :: Data a => a -> SrcSpan -> Pat+findPat = findGen "pat"++findType :: Data a => a -> SrcSpan -> Type+findType = findGen "type"++findDecl :: Data a => a -> SrcSpan -> Decl+findDecl = findGen "decl"++findStmt :: Data a => a -> SrcSpan -> Stmt+findStmt = findGen "stmt"++findName :: Data a => a -> SrcSpan -> (Name, Pat)+findName m ss =+  case findPat m ss of+       p@(GHC.L l (VarPat n)) -> (GHC.L l n, p)+       GHC.L l _ -> error $ "Not var pat: " ++ showGhc l+++findLargestExpression :: SrcSpan -> GHC.Located ast -> Maybe (GHC.Located ast)+findLargestExpression ss e@(GHC.L l _) =+  if l == ss+    then Just e+    else Nothing++-- Deletion from a list++doDeleteStmt :: Data a => (Stmt -> Bool) -> a -> a+doDeleteStmt p = everywhere (mkT (filter p))++doDeleteImport :: Data a => (Import -> Bool) -> a -> a+doDeleteImport p = everywhere (mkT (filter p))++{-+-- Renaming++doRename :: [(String, String)] -> Module -> Module+doRename ss = everywhere (mkT rename)+  where+    rename :: GHC.OccName -> GHC.OccName+    rename v = GHC.mkOccName n s'+      where+          (s, n) = (GHC.occNameString v, GHC.occNameSpace v)+          s' = fromMaybe s (lookup s ss)+-}
+ src/Refact/Fixity.hs view
@@ -0,0 +1,165 @@+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE RecordWildCards #-}+module Refact.Fixity (applyFixities) where++import SrcLoc++import Refact.Utils+import BasicTypes (Fixity(..), defaultFixity, compareFixity, negateFixity, FixityDirection(..))+import HsExpr+import RdrName+import OccName+import PlaceHolder+import Data.Generics hiding (Fixity)+import Data.Maybe+import Language.Haskell.GHC.ExactPrint.Types++import Control.Monad.State+import qualified Data.Map as Map+import Data.Tuple++-- | Rearrange infix expressions to account for fixity.+-- The set of fixities is wired in and includes all fixities in base.+applyFixities :: Anns -> Module -> (Anns, Module)+applyFixities as m = let (as', m') = swap $ runState (everywhereM (mkM expFix) m) as+                     in (as', m') --error (showAnnData as 0 m ++ showAnnData as' 0 m')++expFix :: LHsExpr RdrName -> M (LHsExpr RdrName)+expFix (L loc (OpApp l op _ r)) = do+  mkOpAppRn baseFixities loc l op (findFixity baseFixities op) r++expFix e = return e++getIdent :: Expr -> String+getIdent (unLoc -> HsVar n) = occNameString . rdrNameOcc $ n+getIdent _ = error "Must be HsVar"+++moveDelta :: AnnKey -> AnnKey -> M ()+moveDelta old new = do+  a@Ann{..} <- gets (fromMaybe annNone . Map.lookup old)+  modify (Map.insert new (annNone { annEntryDelta = annEntryDelta, annPriorComments = annPriorComments }))+  modify (Map.insert old (a { annEntryDelta = DP (0,0), annPriorComments = []}))++---------------------------+-- Modified from GHC Renamer+mkOpAppRn ::+             [(String, Fixity)]+          -> SrcSpan+          -> LHsExpr RdrName              -- Left operand; already rearrange+          -> LHsExpr RdrName -> Fixity            -- Operator and fixity+          -> LHsExpr RdrName                      -- Right operand (not an OpApp, but might+                                                -- be a NegApp)+          -> M (LHsExpr RdrName)++-- (e11 `op1` e12) `op2` e2+mkOpAppRn fs loc e1@(L _ (OpApp e11 op1 p e12)) op2 fix2 e2+  | nofix_error+  = return $ L loc (OpApp e1 op2 p e2)++  | associate_right = do+    new_e <- mkOpAppRn fs loc' e12 op2 fix2 e2+    moveDelta (mkAnnKey e12) (mkAnnKey new_e)+    return $ L loc (OpApp e11 op1 p new_e)+  where+    fix1 = findFixity fs op1+    loc'= combineLocs e12 e2+    (nofix_error, associate_right) = compareFixity fix1 fix2++---------------------------+--      (- neg_arg) `op` e2+mkOpAppRn fs loc e1@(L _ (NegApp neg_arg neg_name)) op2 fix2 e2+  | nofix_error+  = return (L loc (OpApp e1 op2 PlaceHolder e2))++  | associate_right+  = do+      new_e <- mkOpAppRn fs loc' neg_arg op2 fix2 e2+      moveDelta (mkAnnKey neg_arg) (mkAnnKey new_e)+      let res = L loc (NegApp new_e neg_name)+          key = mkAnnKey res+          ak  = AnnKey loc (CN "OpApp")+      opAnn <- gets (fromMaybe annNone . Map.lookup ak)+      negAnns <- gets (fromMaybe annNone . Map.lookup (mkAnnKey e1))+      modify (Map.insert key (annNone { annEntryDelta = annEntryDelta opAnn, annsDP = annsDP negAnns }))+      return res++  where+    loc' = combineLocs neg_arg e2+    (nofix_error, associate_right) = compareFixity negateFixity fix2++---------------------------+--      e1 `op` - neg_arg+mkOpAppRn _ loc e1 op1 fix1 e2@(L _ (NegApp _ _))     -- NegApp can occur on the right+  | not associate_right                 -- We *want* right association+  = return $ L loc (OpApp e1 op1 PlaceHolder e2)+  where+    (_, associate_right) = compareFixity fix1 negateFixity++---------------------------+--      Default case+mkOpAppRn _ loc e1 op _ e2                  -- Default case, no rearrangment+  = return $ L loc (OpApp e1 op PlaceHolder e2)++findFixity :: [(String, Fixity)] -> Expr -> Fixity+findFixity fs r = askFix fs (getIdent r)++askFix :: [(String, Fixity)] -> String -> Fixity+askFix xs = \k -> lookupWithDefault defaultFixity k xs+    where+        lookupWithDefault def k mp1 = fromMaybe def $ lookup k mp1++++-- | All fixities defined in the Prelude.+preludeFixities :: [(String, Fixity)]+preludeFixities = concat+    [infixr_ 9  ["."]+    ,infixl_ 9  ["!!"]+    ,infixr_ 8  ["^","^^","**"]+    ,infixl_ 7  ["*","/","quot","rem","div","mod",":%","%"]+    ,infixl_ 6  ["+","-"]+    ,infixr_ 5  [":","++"]+    ,infix_  4  ["==","/=","<","<=",">=",">","elem","notElem"]+    ,infixr_ 3  ["&&"]+    ,infixr_ 2  ["||"]+    ,infixl_ 1  [">>",">>="]+    ,infixr_ 1  ["=<<"]+    ,infixr_ 0  ["$","$!","seq"]+    ]++-- | All fixities defined in the base package.+--+--   Note that the @+++@ operator appears in both Control.Arrows and+--   Text.ParserCombinators.ReadP. The listed precedence for @+++@ in+--   this list is that of Control.Arrows.+baseFixities :: [(String, Fixity)]+baseFixities = preludeFixities ++ concat+    [infixl_ 9 ["!","//","!:"]+    ,infixl_ 8 ["shift","rotate","shiftL","shiftR","rotateL","rotateR"]+    ,infixl_ 7 [".&."]+    ,infixl_ 6 ["xor"]+    ,infix_  6 [":+"]+    ,infixl_ 5 [".|."]+    ,infixr_ 5 ["+:+","<++","<+>"] -- fixity conflict for +++ between ReadP and Arrow+    ,infix_  5 ["\\\\"]+    ,infixl_ 4 ["<$>","<$","<*>","<*","*>","<**>"]+    ,infix_  4 ["elemP","notElemP"]+    ,infixl_ 3 ["<|>"]+    ,infixr_ 3 ["&&&","***"]+    ,infixr_ 2 ["+++","|||"]+    ,infixr_ 1 ["<=<",">=>",">>>","<<<","^<<","<<^","^>>",">>^"]+    ,infixl_ 0 ["on"]+    ,infixr_ 0 ["par","pseq"]+    ]++infixr_, infixl_, infix_ :: Int -> [String] -> [(String,Fixity)]+infixr_ = fixity InfixR+infixl_ = fixity InfixL+infix_  = fixity InfixN++-- Internal: help function for the above definitions.+fixity :: FixityDirection -> Int -> [String] -> [(String, Fixity)]+fixity a p = map (,Fixity p a)+
+ src/Refact/Utils.hs view
@@ -0,0 +1,152 @@+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TupleSections  #-}+{-# LANGUAGE ScopedTypeVariables  #-}+{-# LANGUAGE GADTs  #-}+{-# LANGUAGE RankNTypes  #-}++module Refact.Utils ( -- * Synonyms+                      Module+                    , Stmt+                    , Expr+                    , Decl+                    , Name+                    , Pat+                    , Type+                    , Import+                    -- * Monad+                    , M+                    -- * Utility++                    , mergeAnns+                    , modifyAnnKey+                    , replaceAnnKey+                    , toGhcSrcSpan+                    , findParent++                    ) where++import Language.Haskell.GHC.ExactPrint+import Language.Haskell.GHC.ExactPrint.Types++import Data.Data+import HsExpr as GHC hiding (Stmt)+import SrcLoc+import qualified SrcLoc as GHC+import qualified RdrName as GHC+import qualified ApiAnnotation as GHC+import qualified FastString    as GHC+import qualified GHC hiding (parseModule)+import HsImpExp+import Control.Monad.State++import qualified Data.Map as Map+import Data.Maybe+++import qualified Refact.Types as R+import Refact.Types hiding (SrcSpan)++import Data.Generics.Schemes+import Unsafe.Coerce+++-- Types+--+type M a = State Anns a++type Module = (GHC.Located (GHC.HsModule GHC.RdrName))++type Expr = GHC.Located (GHC.HsExpr GHC.RdrName)++type Type = GHC.Located (GHC.HsType GHC.RdrName)++type Decl = GHC.Located (GHC.HsDecl GHC.RdrName)++type Pat = GHC.LPat GHC.RdrName++type Name = GHC.Located GHC.RdrName++type Stmt = ExprLStmt GHC.RdrName++type Import = LImportDecl GHC.RdrName+++-- | Replaces an old expression with a new expression+replace :: AnnKey -> AnnKey -> AnnKey -> AnnKey -> Anns -> Maybe Anns+replace old new inp parent anns = do+  oldan <- Map.lookup old anns+  newan <- Map.lookup new anns+  oldDelta <- annEntryDelta  <$> Map.lookup parent anns+  return $ Map.insert inp (combine oldDelta oldan newan) anns++combine :: DeltaPos -> Annotation -> Annotation -> Annotation+combine oldDelta oldann newann =+  Ann { annEntryDelta = newEntryDelta+      , annPriorComments = annPriorComments oldann ++ annPriorComments newann+      , annFollowingComments = annFollowingComments oldann ++ annFollowingComments newann+      , annsDP = removeComma (annsDP newann) ++ extraComma (annsDP oldann)+      , annSortKey = annSortKey newann+      , annCapturedSpan = annCapturedSpan newann}+  where+    -- Get rid of structural information when replacing, we assume that the+    -- structural information is already there in the new expression.+    removeComma = filter (\(kw, _) -> case kw of+                                         G GHC.AnnComma -> False+                                         AnnSemiSep -> False+                                         _ -> True)++    -- Make sure to keep structural information when replacing.+    extraComma [] = []+    extraComma (last -> x) = case fst x of+                              G GHC.AnnComma -> [x]+                              AnnSemiSep -> [x]+                              G GHC.AnnSemi -> [x]+                              _ -> []++    newEntryDelta | deltaRow oldDelta > 0 = oldDelta+                  | otherwise = annEntryDelta oldann+++-- | A parent in this case is an element which has the same SrcSpan+findParent :: Data a => GHC.SrcSpan -> a -> Maybe AnnKey+findParent ss = something (findParentWorker ss)+++findParentWorker :: forall a . (Typeable a, Data a)+           => GHC.SrcSpan -> a -> Maybe AnnKey+findParentWorker oldSS a+  | con == typeRepTyCon (typeRep (Proxy :: Proxy (GHC.Located GHC.RdrName))) && x == typeRep (Proxy :: Proxy GHC.SrcSpan)+      = if ss == oldSS+          then Just $ AnnKey ss cn+          else Nothing+  | otherwise = Nothing+  where+    (con, ~[x, _]) = splitTyConApp (typeOf a)+    ss :: GHC.SrcSpan+    ss = gmapQi 0 unsafeCoerce a+    cn = gmapQi 1 (CN . show . toConstr) a+++-- | Perform the necessary adjustments to annotations when replacing+-- one Located thing with another Located thing.+--+-- For example, this function will ensure the correct relative position and+-- make sure that any trailing semi colons or commas are transferred.+modifyAnnKey :: (Data old, Data new, Data mod) => mod -> Located old -> Located new -> M (Located new)+modifyAnnKey m e1 e2 = e2 <$ modify (\m' -> replaceAnnKey m' (mkAnnKey e1) (mkAnnKey e2) (mkAnnKey e2) parentKey)+  where+    parentKey = fromMaybe (mkAnnKey e2) (findParent (getLoc e2) m)+++-- | Lower level version of @modifyAnnKey@+replaceAnnKey ::+  Anns -> AnnKey -> AnnKey -> AnnKey -> AnnKey -> Anns+replaceAnnKey a old new inp deltainfo =+  fromMaybe a (replace old new inp deltainfo a)++-- | Convert a @Refact.Types.SrcSpan@ to a @SrcLoc.SrcSpan@+toGhcSrcSpan :: FilePath -> R.SrcSpan -> SrcSpan+toGhcSrcSpan file R.SrcSpan{..} = mkSrcSpan (f startLine startCol) (f endLine endCol)+  where+    f x y = mkSrcLoc (GHC.mkFastString file) x y
+ tests/Test.hs view
@@ -0,0 +1,58 @@+module Test where++import Test.Tasty+import Test.Tasty.Golden+import System.Directory+import System.FilePath++import Options.Applicative++import Main hiding (main)++import System.IO.Silently+import System.IO++import Debug.Trace+import System.Process+import Test.Tasty.ExpectedFailure+++main =+  defaultMain =<< mkTests <$> findTests++testDir = "tests/examples"++expectedFailures :: [FilePath]+expectedFailures = map (testDir </>) ["Uncurry.hs"]++findTests :: IO [FilePath]+findTests = findByExtension [".hs"] testDir+++mkTests :: [FilePath] -> TestTree+mkTests files = testGroup "Unit tests" (map mkTest files)+  where+    mkTest :: FilePath -> TestTree+    mkTest fp =+      let outfile = fp <.> "out"+          rfile   = fp <.> "refact"+          topts = Options+                  { optionsTarget       = Just fp+                  , optionsInplace       = False+                  , optionsOutput        = Just outfile+                  , optionsRefactFile    = Just rfile+                  , optionsVerbosity     = Silent+                  , optionsStep          = False+                  , optionsRoundtrip     = False+                  , optionsDebug         = False+                  , optionsVersion       = False+                  , optionsPos           = Nothing+                  }+          action =+            hSilence [stderr] $ runPipe topts fp+          diffCmd = \ref new -> ["diff", "-u", ref, new]+          testFn  = if fp `elem` expectedFailures then expectFail else id+      in testFn $ goldenVsFileDiff fp diffCmd (fp <.> "expected") outfile action+++
+ tests/examples/AndList.hs view
@@ -0,0 +1,1 @@+athing = and [a, b]
+ tests/examples/AndList.hs.expected view
@@ -0,0 +1,1 @@+athing = a && b
+ tests/examples/AndList.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/AndList.hs:1:10: Warning: Use &&\nFound:\n  and [a, b]\nWhy not:\n  a && b\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 20}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 16}),("y",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19})], orig = "x && y"}])]
+ tests/examples/Async.hs view
@@ -0,0 +1,11 @@++asyncUsing :: (IO () -> IO ThreadId)+           -> IO a -> IO (Async a)+asyncUsing doFork = \action -> do+   var <- newEmptyTMVarIO+   -- t <- forkFinally action (\r -> atomically $ putTMVar var r)+   -- slightly faster:+   t <- mask $ \restore ->+          doFork $ try (restore action) >>= atomically . putTMVar var+   return (Async t (readTMVar var))+
+ tests/examples/Async.hs.expected view
@@ -0,0 +1,11 @@++asyncUsing :: (IO () -> IO ThreadId)+           -> IO a -> IO (Async a)+asyncUsing doFork action = do+   var <- newEmptyTMVarIO+   -- t <- forkFinally action (\r -> atomically $ putTMVar var r)+   -- slightly faster:+   t <- mask $ \restore ->+          doFork $ try (restore action) >>= atomically . putTMVar var+   return (Async t (readTMVar var))+
+ tests/examples/Async.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Async.hs:4:1: Error: Redundant lambda\nFound:\n  asyncUsing doFork\n    = \\ action ->\n        do var <- newEmptyTMVarIO\n           t <- mask $\n                  \\ restore ->\n                    doFork $ try (restore action) >>= atomically . putTMVar var\n           return (Async t (readTMVar var))\nWhy not:\n  asyncUsing doFork action\n    = do var <- newEmptyTMVarIO\n         t <- mask $\n                \\ restore ->\n                  doFork $ try (restore action) >>= atomically . putTMVar var\n         return (Async t (readTMVar var))\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 4, startCol = 1, endLine = 10, endCol = 36}, subts = [("body",SrcSpan {startLine = 4, startCol = 32, endLine = 10, endCol = 36}),("a",SrcSpan {startLine = 4, startCol = 12, endLine = 4, endCol = 18}),("b",SrcSpan {startLine = 4, startCol = 22, endLine = 4, endCol = 28})], orig = "asyncUsing a b = body"}])]
+ tests/examples/Bracket0.hs view
@@ -0,0 +1,1 @@+yes = (f x) x
+ tests/examples/Bracket0.hs.expected view
@@ -0,0 +1,1 @@+yes = f x x
+ tests/examples/Bracket0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket0.hs:1:7: Warning: Redundant bracket\nFound:\n  (f x) x\nWhy not:\n  f x x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 12}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 11})], orig = "x"}])]
+ tests/examples/Bracket1.hs view
@@ -0,0 +1,1 @@+no = f (x x)
+ tests/examples/Bracket1.hs.expected view
@@ -0,0 +1,1 @@+no = f (x x)
+ tests/examples/Bracket1.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket10.hs view
@@ -0,0 +1,1 @@+yes = [(foo bar)]
+ tests/examples/Bracket10.hs.expected view
@@ -0,0 +1,1 @@+yes = [foo bar]
+ tests/examples/Bracket10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket10.hs:1:7: Warning: Redundant bracket\nFound:\n  [(foo bar)]\nWhy not:\n  [foo bar]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 17}, subts = [("x",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 16})], orig = "x"}])]
+ tests/examples/Bracket11.hs view
@@ -0,0 +1,1 @@+yes = foo ((x y), z)
+ tests/examples/Bracket11.hs.expected view
@@ -0,0 +1,1 @@+yes = foo (x y, z)
+ tests/examples/Bracket11.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket11.hs:1:11: Warning: Redundant bracket\nFound:\n  ((x y), z)\nWhy not:\n  (x y, z)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 17}, subts = [("x",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 16})], orig = "x"}])]
+ tests/examples/Bracket12.hs view
@@ -0,0 +1,1 @@+yes = C { f = (e h) }
+ tests/examples/Bracket12.hs.expected view
@@ -0,0 +1,1 @@+yes = C { f = e h }
+ tests/examples/Bracket12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket12.hs:1:7: Warning: Redundant bracket\nFound:\n  C{f = (e h)}\nWhy not:\n  C{f = e h}\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 20}, subts = [("x",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 19})], orig = "x"}])]
+ tests/examples/Bracket13.hs view
@@ -0,0 +1,1 @@+yes = \ x -> (x && x)
+ tests/examples/Bracket13.hs.expected view
@@ -0,0 +1,1 @@+yes x = x && x
+ tests/examples/Bracket13.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket13.hs:1:1: Error: Redundant lambda\nFound:\n  yes = \\ x -> (x && x)\nWhy not:\n  yes x = x && x\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 22}, subts = [("body",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 21}),("a",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 10})], orig = "yes a = body"}]),("tests/examples/Bracket13.hs:1:7: Warning: Redundant bracket\nFound:\n  \\ x -> (x && x)\nWhy not:\n  \\ x -> x && x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 22}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 21})], orig = "x"}])]
+ tests/examples/Bracket14.hs view
@@ -0,0 +1,1 @@+no = \(x -> y) -> z
+ tests/examples/Bracket14.hs.expected view
@@ -0,0 +1,1 @@+no (x -> y) = z
+ tests/examples/Bracket14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket14.hs:1:1: Error: Redundant lambda\nFound:\n  no = \\ (x -> y) -> z\nWhy not:\n  no (x -> y) = z\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 20}, subts = [("body",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 20}),("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 15})], orig = "no a = body"}])]
+ tests/examples/Bracket15.hs view
@@ -0,0 +1,1 @@+yes = (`foo` (bar baz))
+ tests/examples/Bracket15.hs.expected view
@@ -0,0 +1,1 @@+yes = (`foo` bar baz)
+ tests/examples/Bracket15.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket15.hs:1:7: Warning: Redundant bracket\nFound:\n  (`foo` (bar baz))\nWhy not:\n  (`foo` bar baz)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 22})], orig = "x"}])]
+ tests/examples/Bracket16.hs view
@@ -0,0 +1,1 @@+main = do f; (print x)
+ tests/examples/Bracket16.hs.expected view
@@ -0,0 +1,1 @@+main = do f; print x
+ tests/examples/Bracket16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket16.hs:1:8: Warning: Redundant bracket\nFound:\n  do f\n     (print x)\nWhy not:\n  do f\n     print x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 22})], orig = "x"}])]
+ tests/examples/Bracket17.hs view
@@ -0,0 +1,1 @@+foo :: (Int -> Int) -> Int
+ tests/examples/Bracket17.hs.expected view
@@ -0,0 +1,1 @@+foo :: (Int -> Int) -> Int
+ tests/examples/Bracket17.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket18.hs view
@@ -0,0 +1,1 @@+foo :: Int -> (Int -> Int)
+ tests/examples/Bracket18.hs.expected view
@@ -0,0 +1,1 @@+foo :: Int -> Int -> Int
+ tests/examples/Bracket18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket18.hs:1:8: Warning: Redundant bracket\nFound:\n  Int -> (Int -> Int)\nWhy not:\n  Int -> Int -> Int\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 27}, subts = [("x",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 26})], orig = "x"}])]
+ tests/examples/Bracket19.hs view
@@ -0,0 +1,1 @@+foo :: (Maybe Int) -> a
+ tests/examples/Bracket19.hs.expected view
@@ -0,0 +1,1 @@+foo :: Maybe Int -> a
+ tests/examples/Bracket19.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket19.hs:1:8: Warning: Redundant bracket\nFound:\n  (Maybe Int) -> a\nWhy not:\n  Maybe Int -> a\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 19}, subts = [("x",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 18})], orig = "x"}])]
+ tests/examples/Bracket2.hs view
@@ -0,0 +1,1 @@+yes = (foo)
+ tests/examples/Bracket2.hs.expected view
@@ -0,0 +1,1 @@+yes = foo
+ tests/examples/Bracket2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket2.hs:1:7: Warning: Redundant bracket\nFound:\n  (foo)\nWhy not:\n  foo\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 12}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 11})], orig = "x"}])]
+ tests/examples/Bracket20.hs view
@@ -0,0 +1,1 @@+instance Named (DeclHead S)
+ tests/examples/Bracket20.hs.expected view
@@ -0,0 +1,1 @@+instance Named (DeclHead S)
+ tests/examples/Bracket20.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket21.hs view
@@ -0,0 +1,1 @@+data Foo = Foo {foo :: (Maybe Foo)}
+ tests/examples/Bracket21.hs.expected view
@@ -0,0 +1,1 @@+data Foo = Foo {foo :: Maybe Foo}
+ tests/examples/Bracket21.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket21.hs:1:17: Warning: Redundant bracket\nFound:\n  foo :: (Maybe Foo)\nWhy not:\n  foo :: Maybe Foo\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 35}, subts = [("x",SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 34})], orig = "x"}])]
+ tests/examples/Bracket22.hs view
@@ -0,0 +1,1 @@+foo (True) = 1
+ tests/examples/Bracket22.hs.expected view
@@ -0,0 +1,1 @@+foo (True) = 1
+ tests/examples/Bracket22.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket23.hs view
@@ -0,0 +1,1 @@+foo ((True)) = 1
+ tests/examples/Bracket23.hs.expected view
@@ -0,0 +1,1 @@+foo (True) = 1
+ tests/examples/Bracket23.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket23.hs:1:6: Error: Redundant bracket\nFound:\n  (True)\nWhy not:\n  True\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 1, startCol = 6, endLine = 1, endCol = 12}, subts = [("x",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 11})], orig = "x"}])]
+ tests/examples/Bracket24.hs view
@@ -0,0 +1,1 @@+no = groupFsts . sortFst $ mr
+ tests/examples/Bracket24.hs.expected view
@@ -0,0 +1,1 @@+no = groupFsts . sortFst $ mr
+ tests/examples/Bracket24.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket25.hs view
@@ -0,0 +1,1 @@+yes = split "to" $ names
+ tests/examples/Bracket25.hs.expected view
@@ -0,0 +1,1 @@+yes = split "to" names
+ tests/examples/Bracket25.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket25.hs:1:7: Warning: Redundant $\nFound:\n  split \"to\" $ names\nWhy not:\n  split \"to\" names\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 25}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 17}),("b",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 25})], orig = "a b"}])]
+ tests/examples/Bracket26.hs view
@@ -0,0 +1,1 @@+yes = white $ keysymbol
+ tests/examples/Bracket26.hs.expected view
@@ -0,0 +1,1 @@+yes = white keysymbol
+ tests/examples/Bracket26.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket26.hs:1:7: Warning: Redundant $\nFound:\n  white $ keysymbol\nWhy not:\n  white keysymbol\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 24}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 12}),("b",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 24})], orig = "a b"}])]
+ tests/examples/Bracket27.hs view
@@ -0,0 +1,1 @@+yes = operator foo $ operator
+ tests/examples/Bracket27.hs.expected view
@@ -0,0 +1,1 @@+yes = operator foo operator
+ tests/examples/Bracket27.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket27.hs:1:7: Warning: Redundant $\nFound:\n  operator foo $ operator\nWhy not:\n  operator foo operator\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 30}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 19}),("b",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 30})], orig = "a b"}])]
+ tests/examples/Bracket28.hs view
@@ -0,0 +1,1 @@+no = operator foo $ operator bar
+ tests/examples/Bracket28.hs.expected view
@@ -0,0 +1,1 @@+no = operator foo $ operator bar
+ tests/examples/Bracket28.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket29.hs view
@@ -0,0 +1,1 @@+yes = return $ Record{a=b}
+ tests/examples/Bracket29.hs.expected view
@@ -0,0 +1,1 @@+yes = return Record{a=b}
+ tests/examples/Bracket29.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket29.hs:1:7: Warning: Redundant $\nFound:\n  return $ Record{a = b}\nWhy not:\n  return Record{a = b}\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 27}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 13}),("b",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 27})], orig = "a b"}])]
+ tests/examples/Bracket3.hs view
@@ -0,0 +1,1 @@+yes = (foo bar)
+ tests/examples/Bracket3.hs.expected view
@@ -0,0 +1,1 @@+yes = foo bar
+ tests/examples/Bracket3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket3.hs:1:7: Warning: Redundant bracket\nFound:\n  (foo bar)\nWhy not:\n  foo bar\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 16}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 15})], orig = "x"}])]
+ tests/examples/Bracket30.hs view
@@ -0,0 +1,1 @@+yes = (b $ c d) ++ e
+ tests/examples/Bracket30.hs.expected view
@@ -0,0 +1,1 @@+yes = b (c d) ++ e
+ tests/examples/Bracket30.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket30.hs:1:7: Warning: Move brackets to avoid $\nFound:\n  (b $ c d) ++ e\nWhy not:\n  b (c d) ++ e\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 16}, subts = [("a",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9}),("b",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 15})], orig = "a (b)"}])]
+ tests/examples/Bracket31.hs view
@@ -0,0 +1,1 @@+yes = (a b $ c d) ++ e
+ tests/examples/Bracket31.hs.expected view
@@ -0,0 +1,1 @@+yes = a b (c d) ++ e
+ tests/examples/Bracket31.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket31.hs:1:7: Warning: Move brackets to avoid $\nFound:\n  (a b $ c d) ++ e\nWhy not:\n  a b (c d) ++ e\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 18}, subts = [("a",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 11}),("b",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 17})], orig = "a (b)"}])]
+ tests/examples/Bracket32.hs view
@@ -0,0 +1,1 @@+no = (f . g $ a) ++ e
+ tests/examples/Bracket32.hs.expected view
@@ -0,0 +1,1 @@+no = (f . g $ a) ++ e
+ tests/examples/Bracket32.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket33.hs view
@@ -0,0 +1,1 @@+no = quickCheck ((\h -> cySucc h == succ h) :: Hygiene -> Bool)
+ tests/examples/Bracket33.hs.expected view
@@ -0,0 +1,1 @@+no = quickCheck ((\h -> cySucc h == succ h) :: Hygiene -> Bool)
+ tests/examples/Bracket33.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket34.hs view
@@ -0,0 +1,1 @@+foo = (case x of y -> z; q -> w) :: Int
+ tests/examples/Bracket34.hs.expected view
@@ -0,0 +1,1 @@+foo = (case x of y -> z; q -> w) :: Int
+ tests/examples/Bracket34.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket35.hs view
@@ -0,0 +1,1 @@+main = do a += b . c; return $ a . b
+ tests/examples/Bracket35.hs.expected view
@@ -0,0 +1,1 @@+main = do a += b . c; return $ a . b
+ tests/examples/Bracket35.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket36.hs view
@@ -0,0 +1,1 @@+main = 1; {-# ANN module ("HLint: ignore Use camelCase" :: String) #-}
+ tests/examples/Bracket36.hs.expected view
@@ -0,0 +1,1 @@+main = 1; {-# ANN module ("HLint: ignore Use camelCase" :: String) #-}
+ tests/examples/Bracket36.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Bracket37.hs view
@@ -0,0 +1,1 @@+main = 1; {-# ANN module (1 + (2)) #-}
+ tests/examples/Bracket37.hs.expected view
@@ -0,0 +1,1 @@+main = 1; {-# ANN module (1 + 2) #-}
+ tests/examples/Bracket37.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket37.hs:1:31: Error: Redundant bracket\nFound:\n  (2)\nWhy not:\n  2\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 34}, subts = [("x",SrcSpan {startLine = 1, startCol = 32, endLine = 1, endCol = 33})], orig = "x"}])]
+ tests/examples/Bracket4.hs view
@@ -0,0 +1,1 @@+yes = foo (bar)
+ tests/examples/Bracket4.hs.expected view
@@ -0,0 +1,1 @@+yes = foo bar
+ tests/examples/Bracket4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket4.hs:1:11: Error: Redundant bracket\nFound:\n  (bar)\nWhy not:\n  bar\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 16}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 15})], orig = "x"}])]
+ tests/examples/Bracket5.hs view
@@ -0,0 +1,1 @@+yes = foo ((x x))
+ tests/examples/Bracket5.hs.expected view
@@ -0,0 +1,1 @@+yes = foo (x x)
+ tests/examples/Bracket5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket5.hs:1:11: Error: Redundant bracket\nFound:\n  ((x x))\nWhy not:\n  (x x)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 18}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 17})], orig = "x"}])]
+ tests/examples/Bracket6.hs view
@@ -0,0 +1,1 @@+yes = (f x) ||| y
+ tests/examples/Bracket6.hs.expected view
@@ -0,0 +1,1 @@+yes = f x ||| y
+ tests/examples/Bracket6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket6.hs:1:7: Warning: Redundant bracket\nFound:\n  (f x) ||| y\nWhy not:\n  f x ||| y\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 12}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 11})], orig = "x"}])]
+ tests/examples/Bracket7.hs view
@@ -0,0 +1,1 @@+yes = if (f x) then y else z
+ tests/examples/Bracket7.hs.expected view
@@ -0,0 +1,1 @@+yes = if f x then y else z
+ tests/examples/Bracket7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket7.hs:1:7: Warning: Redundant bracket\nFound:\n  if (f x) then y else z\nWhy not:\n  if f x then y else z\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 15}, subts = [("x",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 14})], orig = "x"}])]
+ tests/examples/Bracket8.hs view
@@ -0,0 +1,1 @@+yes = if x then (f y) else z
+ tests/examples/Bracket8.hs.expected view
@@ -0,0 +1,1 @@+yes = if x then f y else z
+ tests/examples/Bracket8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket8.hs:1:7: Warning: Redundant bracket\nFound:\n  if x then (f y) else z\nWhy not:\n  if x then f y else z\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 22}, subts = [("x",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 21})], orig = "x"}])]
+ tests/examples/Bracket9.hs view
@@ -0,0 +1,1 @@+yes = (a foo) :: Int
+ tests/examples/Bracket9.hs.expected view
@@ -0,0 +1,1 @@+yes = a foo :: Int
+ tests/examples/Bracket9.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket9.hs:1:7: Warning: Redundant bracket\nFound:\n  (a foo) :: Int\nWhy not:\n  a foo :: Int\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 14}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 13})], orig = "x"}])]
+ tests/examples/Comment0.hs view
@@ -0,0 +1,1 @@+{- MISSING HASH #-}
+ tests/examples/Comment0.hs.expected view
@@ -0,0 +1,1 @@+{-# MISSING HASH #-}
+ tests/examples/Comment0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Comment0.hs:1:1: Warning: Fix pragma markup\nFound:\n  {- MISSING HASH #-}\nWhy not:\n  {-# MISSING HASH #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 20}, newComment = "{-# MISSING HASH #-}"}])]
+ tests/examples/Comment1.hs view
@@ -0,0 +1,1 @@+-- {- INLINE X -}
+ tests/examples/Comment1.hs.expected view
@@ -0,0 +1,1 @@+-- {- INLINE X -}
+ tests/examples/Comment1.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Comment2.hs view
@@ -0,0 +1,1 @@+{- INLINE Y -}
+ tests/examples/Comment2.hs.expected view
@@ -0,0 +1,1 @@+{-# INLINE Y #-}
+ tests/examples/Comment2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Comment2.hs:1:1: Warning: Use pragma syntax\nFound:\n  {- INLINE Y -}\nWhy not:\n  {-# INLINE Y #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 15}, newComment = "{-# INLINE Y #-}"}])]
+ tests/examples/Comment3.hs view
@@ -0,0 +1,1 @@+{- INLINE[~k] f -}
+ tests/examples/Comment3.hs.expected view
@@ -0,0 +1,1 @@+{-# INLINE[~k] f #-}
+ tests/examples/Comment3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Comment3.hs:1:1: Warning: Use pragma syntax\nFound:\n  {- INLINE[~k] f -}\nWhy not:\n  {-# INLINE[~k] f #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 19}, newComment = "{-# INLINE[~k] f #-}"}])]
+ tests/examples/Comment4.hs view
@@ -0,0 +1,1 @@+{- NOINLINE Y -}
+ tests/examples/Comment4.hs.expected view
@@ -0,0 +1,1 @@+{-# NOINLINE Y #-}
+ tests/examples/Comment4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Comment4.hs:1:1: Warning: Use pragma syntax\nFound:\n  {- NOINLINE Y -}\nWhy not:\n  {-# NOINLINE Y #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 17}, newComment = "{-# NOINLINE Y #-}"}])]
+ tests/examples/Comment5.hs view
@@ -0,0 +1,1 @@+{- UNKNOWN Y -}
+ tests/examples/Comment5.hs.expected view
@@ -0,0 +1,1 @@+{- UNKNOWN Y -}
+ tests/examples/Comment5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Comment6.hs view
@@ -0,0 +1,1 @@+-- INLINE X
+ tests/examples/Comment6.hs.expected view
@@ -0,0 +1,1 @@+-- INLINE X
+ tests/examples/Comment6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default0.hs view
@@ -0,0 +1,1 @@+yes = concat . map f
+ tests/examples/Default0.hs.expected view
@@ -0,0 +1,1 @@+yes = concatMap f
+ tests/examples/Default0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default0.hs:1:7: Error: Use concatMap\nFound:\n  concat . map f\nWhy not:\n  concatMap f\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 21}, subts = [("f",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21})], orig = "concatMap f"}])]
+ tests/examples/Default1.hs view
@@ -0,0 +1,1 @@+yes = foo . bar . concat . map f . baz . bar
+ tests/examples/Default1.hs.expected view
@@ -0,0 +1,1 @@+yes = foo . bar . concatMap f . baz . bar
+ tests/examples/Default1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default1.hs:1:19: Error: Use concatMap\nFound:\n  concat . map f . baz . bar\nWhy not:\n  concatMap f . baz . bar\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 45}, subts = [("f",SrcSpan {startLine = 1, startCol = 32, endLine = 1, endCol = 33}),("x",SrcSpan {startLine = 1, startCol = 36, endLine = 1, endCol = 45})], orig = "concatMap f . x"}])]
+ tests/examples/Default10.hs view
@@ -0,0 +1,1 @@+yes = not (a /= b)
+ tests/examples/Default10.hs.expected view
@@ -0,0 +1,1 @@+yes = a == b
+ tests/examples/Default10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default10.hs:1:7: Error: Use ==\nFound:\n  not (a /= b)\nWhy not:\n  a == b\nNote: incorrect if either value is NaN\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 19}, subts = [("a",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 13}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18})], orig = "a == b"}])]
+ tests/examples/Default100.hs view
@@ -0,0 +1,1 @@+foo = return $! 1
+ tests/examples/Default100.hs.expected view
@@ -0,0 +1,1 @@+foo = return $! 1
+ tests/examples/Default100.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default101.hs view
@@ -0,0 +1,1 @@+foo = return $! "test"
+ tests/examples/Default101.hs.expected view
@@ -0,0 +1,1 @@+foo = return $! "test"
+ tests/examples/Default101.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default102.hs view
@@ -0,0 +1,1 @@+bar = [x| (x,_) <- pts]
+ tests/examples/Default102.hs.expected view
@@ -0,0 +1,1 @@+bar = [x| (x,_) <- pts]
+ tests/examples/Default102.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default103.hs view
@@ -0,0 +1,1 @@+return' x = x `seq` return x
+ tests/examples/Default103.hs.expected view
@@ -0,0 +1,1 @@+return' x = x `seq` return x
+ tests/examples/Default103.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default104.hs view
@@ -0,0 +1,1 @@+foo = last (sortBy (compare `on` fst) xs)
+ tests/examples/Default104.hs.expected view
@@ -0,0 +1,1 @@+foo = maximumBy (compare `on` fst) xs
+ tests/examples/Default104.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default104.hs:1:7: Error: Use maximumBy\nFound:\n  last (sortBy (compare `on` fst) xs)\nWhy not:\n  maximumBy (compare `on` fst) xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 42}, subts = [("f",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 38}),("x",SrcSpan {startLine = 1, startCol = 39, endLine = 1, endCol = 41})], orig = "maximumBy f x"}])]
+ tests/examples/Default105.hs view
@@ -0,0 +1,1 @@+g = \ f -> parseFile f >>= (\ cu -> return (f, cu))
+ tests/examples/Default105.hs.expected view
@@ -0,0 +1,1 @@+g f = parseFile f >>= (\ cu -> return (f, cu))
+ tests/examples/Default105.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default105.hs:1:1: Error: Redundant lambda\nFound:\n  g = \\ f -> parseFile f >>= (\\ cu -> return (f, cu))\nWhy not:\n  g f = parseFile f >>= (\\ cu -> return (f, cu))\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 52}, subts = [("body",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 52}),("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8})], orig = "g a = body"}])]
+ tests/examples/Default106.hs view
@@ -0,0 +1,1 @@+foo = bar $ \(x,y) -> x x y
+ tests/examples/Default106.hs.expected view
@@ -0,0 +1,1 @@+foo = bar $ \(x,y) -> x x y
+ tests/examples/Default106.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default107.hs view
@@ -0,0 +1,1 @@+foo = qux (\x -> f x >>= g)
+ tests/examples/Default107.hs.expected view
@@ -0,0 +1,1 @@+foo = qux (f Control.Monad.>=> g)
+ tests/examples/Default107.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default107.hs:1:12: Warning: Use >=>\nFound:\n  \\ x -> f x >>= g\nWhy not:\n  f Control.Monad.>=> g\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 27}, subts = [("f",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19}),("g",SrcSpan {startLine = 1, startCol = 26, endLine = 1, endCol = 27})], orig = "f Control.Monad.>=> g"}])]
+ tests/examples/Default108.hs view
@@ -0,0 +1,1 @@+foo = qux (\f -> h f >>= g)
+ tests/examples/Default108.hs.expected view
@@ -0,0 +1,1 @@+foo = qux (h Control.Monad.>=> g)
+ tests/examples/Default108.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default108.hs:1:12: Warning: Use >=>\nFound:\n  \\ f -> h f >>= g\nWhy not:\n  h Control.Monad.>=> g\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 27}, subts = [("f",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19}),("g",SrcSpan {startLine = 1, startCol = 26, endLine = 1, endCol = 27})], orig = "f Control.Monad.>=> g"}])]
+ tests/examples/Default109.hs view
@@ -0,0 +1,1 @@+foo = qux (\f -> h f >>= f)
+ tests/examples/Default109.hs.expected view
@@ -0,0 +1,1 @@+foo = qux (\f -> h f >>= f)
+ tests/examples/Default109.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default11.hs view
@@ -0,0 +1,1 @@+yes = qux (if a then 1 else if b then 1 else 2)
+ tests/examples/Default11.hs.expected view
@@ -0,0 +1,1 @@+yes = qux (if a || b then 1 else 2)
+ tests/examples/Default11.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default11.hs:1:12: Error: Redundant if\nFound:\n  if a then 1 else if b then 1 else 2\nWhy not:\n  if a || b then 1 else 2\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 47}, subts = [("a",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 16}),("b",SrcSpan {startLine = 1, startCol = 32, endLine = 1, endCol = 33}),("f",SrcSpan {startLine = 1, startCol = 46, endLine = 1, endCol = 47}),("t",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "if a || b then t else f"}])]
+ tests/examples/Default110.hs view
@@ -0,0 +1,1 @@+foo = bar $ \x -> [x,y]
+ tests/examples/Default110.hs.expected view
@@ -0,0 +1,1 @@+foo = bar $ \x -> [x,y]
+ tests/examples/Default110.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default111.hs view
@@ -0,0 +1,1 @@+foo = bar $ \x -> [z,y]
+ tests/examples/Default111.hs.expected view
@@ -0,0 +1,1 @@+foo = bar $ const [z,y]
+ tests/examples/Default111.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default111.hs:1:13: Warning: Use const\nFound:\n  \\ x -> [z, y]\nWhy not:\n  const [z, y]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 24}, subts = [("y",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 24})], orig = "const y"}])]
+ tests/examples/Default112.hs view
@@ -0,0 +1,1 @@+f condition tChar tBool = if condition then _monoField tChar else _monoField tBool
+ tests/examples/Default112.hs.expected view
@@ -0,0 +1,1 @@+f condition tChar tBool = if condition then _monoField tChar else _monoField tBool
+ tests/examples/Default112.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default113.hs view
@@ -0,0 +1,1 @@+foo = maybe Bar{..} id
+ tests/examples/Default113.hs.expected view
@@ -0,0 +1,1 @@+foo = Data.Maybe.fromMaybe Bar{..}
+ tests/examples/Default113.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default113.hs:1:7: Error: Use fromMaybe\nFound:\n  maybe Bar{..} id\nWhy not:\n  Data.Maybe.fromMaybe Bar{..}\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 20})], orig = "Data.Maybe.fromMaybe x"}])]
+ tests/examples/Default114.hs view
@@ -0,0 +1,1 @@+foo = (\a -> Foo {..}) 1
+ tests/examples/Default114.hs.expected view
@@ -0,0 +1,1 @@+foo = (\a -> Foo {..}) 1
+ tests/examples/Default114.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default115.hs view
@@ -0,0 +1,1 @@+foo = zipWith SymInfo [0 ..] (repeat ty)
+ tests/examples/Default115.hs.expected view
@@ -0,0 +1,1 @@+foo = map (\ x -> SymInfo x ty) [0 ..]
+ tests/examples/Default115.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default115.hs:1:7: Error: Use map\nFound:\n  zipWith SymInfo [0 ..] (repeat ty)\nWhy not:\n  map (\\ x -> SymInfo x ty) [0 ..]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 41}, subts = [("f",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 22}),("y",SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 29}),("z",SrcSpan {startLine = 1, startCol = 38, endLine = 1, endCol = 40})], orig = "map (\\ x -> f x z) y"}])]
+ tests/examples/Default116.hs view
@@ -0,0 +1,2 @@+import Prelude +yes = flip mapM
+ tests/examples/Default116.hs.expected view
@@ -0,0 +1,2 @@+import Prelude+yes = Control.Monad.forM
+ tests/examples/Default116.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default116.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  Control.Monad.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default117.hs view
@@ -0,0 +1,2 @@+import Control.Monad +yes = flip mapM
+ tests/examples/Default117.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad+yes = Control.Monad.forM
+ tests/examples/Default117.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default117.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default118.hs view
@@ -0,0 +1,2 @@+import Control.Monad(forM) +yes = flip mapM
+ tests/examples/Default118.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad(forM)+yes = Control.Monad.forM
+ tests/examples/Default118.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default118.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default119.hs view
@@ -0,0 +1,2 @@+import Control.Monad(forM_) +yes = flip mapM
+ tests/examples/Default119.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad(forM_)+yes = Control.Monad.forM
+ tests/examples/Default119.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default119.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  Control.Monad.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default12.hs view
@@ -0,0 +1,1 @@+no  = if a then 1 else if b then 3 else 2
+ tests/examples/Default12.hs.expected view
@@ -0,0 +1,1 @@+no  = if a then 1 else if b then 3 else 2
+ tests/examples/Default12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default12.hs:1:1: Warning: Use guards\nFound:\n  no = if a then 1 else if b then 3 else 2\nWhy not:\n  no\n    | a = 1\n    | b = 3\n    | otherwise = 2\n",[Replace {rtype = Bind, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 42}, subts = [("g1001",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11}),("g1002",SrcSpan {startLine = 1, startCol = 27, endLine = 1, endCol = 28}),("e1001",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18}),("e1002",SrcSpan {startLine = 1, startCol = 34, endLine = 1, endCol = 35}),("e1003",SrcSpan {startLine = 1, startCol = 41, endLine = 1, endCol = 42})], orig = "no\n  | g1001 = e1001\n  | g1002 = e1002\n  | otherwise = e1003"}])]
+ tests/examples/Default120.hs view
@@ -0,0 +1,2 @@+import qualified Control.Monad +yes = flip mapM
+ tests/examples/Default120.hs.expected view
@@ -0,0 +1,2 @@+import qualified Control.Monad+yes = Control.Monad.forM
+ tests/examples/Default120.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default120.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  Control.Monad.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default121.hs view
@@ -0,0 +1,2 @@+import qualified Control.Monad as CM +yes = flip mapM
+ tests/examples/Default121.hs.expected view
@@ -0,0 +1,2 @@+import qualified Control.Monad as CM+yes = Control.Monad.forM
+ tests/examples/Default121.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default121.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  CM.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default122.hs view
@@ -0,0 +1,2 @@+import qualified Control.Monad as CM(forM,filterM) +yes = flip mapM
+ tests/examples/Default122.hs.expected view
@@ -0,0 +1,2 @@+import qualified Control.Monad as CM(forM,filterM)+yes = Control.Monad.forM
+ tests/examples/Default122.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default122.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  CM.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default123.hs view
@@ -0,0 +1,2 @@+import Control.Monad as CM(forM,filterM) +yes = flip mapM
+ tests/examples/Default123.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad as CM(forM,filterM)+yes = Control.Monad.forM
+ tests/examples/Default123.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default123.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default124.hs view
@@ -0,0 +1,2 @@+import Control.Monad hiding (forM) +yes = flip mapM
+ tests/examples/Default124.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad hiding (forM)+yes = Control.Monad.forM
+ tests/examples/Default124.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default124.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  Control.Monad.forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default125.hs view
@@ -0,0 +1,2 @@+import Control.Monad hiding (filterM) +yes = flip mapM
+ tests/examples/Default125.hs.expected view
@@ -0,0 +1,2 @@+import Control.Monad hiding (filterM)+yes = Control.Monad.forM
+ tests/examples/Default125.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default125.hs:2:7: Warning: Use forM\nFound:\n  flip mapM\nWhy not:\n  forM\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 7, endLine = 2, endCol = 16}, subts = [], orig = "Control.Monad.forM"}])]
+ tests/examples/Default126.hs view
@@ -0,0 +1,2 @@+import qualified Data.Text.Lazy as DTL +main = DTL.concat $ map (`DTL.snoc` '-') [DTL.pack "one", DTL.pack "two", DTL.pack "three"]
+ tests/examples/Default126.hs.expected view
@@ -0,0 +1,2 @@+import qualified Data.Text.Lazy as DTL+main = DTL.concat $ map (`DTL.snoc` '-') [DTL.pack "one", DTL.pack "two", DTL.pack "three"]
+ tests/examples/Default126.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default127.hs view
@@ -0,0 +1,2 @@+import Text.Blaze.Html5.Attributes as A +main = A.id (stringValue id')
+ tests/examples/Default127.hs.expected view
@@ -0,0 +1,2 @@+import Text.Blaze.Html5.Attributes as A+main = A.id (stringValue id')
+ tests/examples/Default127.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default128.hs view
@@ -0,0 +1,1 @@+foo = qux (\x -> f x >>= g)
+ tests/examples/Default128.hs.expected view
@@ -0,0 +1,1 @@+foo = qux (f Control.Monad.>=> g)
+ tests/examples/Default128.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default128.hs:1:12: Warning: Use >=>\nFound:\n  \\ x -> f x >>= g\nWhy not:\n  f Control.Monad.>=> g\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 27}, subts = [("f",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19}),("g",SrcSpan {startLine = 1, startCol = 26, endLine = 1, endCol = 27})], orig = "f Control.Monad.>=> g"}])]
+ tests/examples/Default13.hs view
@@ -0,0 +1,1 @@+yes = a >>= return . bob
+ tests/examples/Default13.hs.expected view
@@ -0,0 +1,1 @@+yes = Control.Monad.liftM bob a
+ tests/examples/Default13.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default13.hs:1:7: Warning: Use liftM\nFound:\n  a >>= return . bob\nWhy not:\n  Control.Monad.liftM bob a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 25}, subts = [("f",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 25}),("m",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8})], orig = "Control.Monad.liftM f m"}])]
+ tests/examples/Default14.hs view
@@ -0,0 +1,1 @@+yes = (x !! 0) + (x !! 2)
+ tests/examples/Default14.hs.expected view
@@ -0,0 +1,1 @@+yes = (head x) + (x !! 2)
+ tests/examples/Default14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default14.hs:1:8: Warning: Use head\nFound:\n  x !! 0\nWhy not:\n  head x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 14}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9})], orig = "head x"}])]
+ tests/examples/Default15.hs view
@@ -0,0 +1,1 @@+yes = if b < 42 then [a] else []
+ tests/examples/Default15.hs.expected view
@@ -0,0 +1,1 @@+yes = [a | b < 42]
+ tests/examples/Default15.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default15.hs:1:7: Warning: Use list comprehension\nFound:\n  if b < 42 then [a] else []\nWhy not:\n  [a | b < 42]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 33}, subts = [("b",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 16}),("x",SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 24})], orig = "[x | b]"}])]
+ tests/examples/Default16.hs view
@@ -0,0 +1,1 @@+no  = take n (foo xs) == "hello"
+ tests/examples/Default16.hs.expected view
@@ -0,0 +1,1 @@+no  = take n (foo xs) == "hello"
+ tests/examples/Default16.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default17.hs view
@@ -0,0 +1,1 @@+yes = head (reverse xs)
+ tests/examples/Default17.hs.expected view
@@ -0,0 +1,1 @@+yes = last xs
+ tests/examples/Default17.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default17.hs:1:7: Error: Use last\nFound:\n  head (reverse xs)\nWhy not:\n  last xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 24}, subts = [("x",SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 23})], orig = "last x"}])]
+ tests/examples/Default18.hs view
@@ -0,0 +1,1 @@+yes = reverse xs `isPrefixOf` reverse ys
+ tests/examples/Default18.hs.expected view
@@ -0,0 +1,1 @@+yes = isSuffixOf xs ys
+ tests/examples/Default18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default18.hs:1:7: Error: Use isSuffixOf\nFound:\n  reverse xs `isPrefixOf` reverse ys\nWhy not:\n  isSuffixOf xs ys\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 41}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 17}),("y",SrcSpan {startLine = 1, startCol = 39, endLine = 1, endCol = 41})], orig = "isSuffixOf x y"}])]
+ tests/examples/Default19.hs view
@@ -0,0 +1,1 @@+no = putStrLn $ show (length xs) ++ "Test"
+ tests/examples/Default19.hs.expected view
@@ -0,0 +1,1 @@+no = putStrLn $ show (length xs) ++ "Test"
+ tests/examples/Default19.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default2.hs view
@@ -0,0 +1,1 @@+yes = map f (map g x)
+ tests/examples/Default2.hs.expected view
@@ -0,0 +1,1 @@+yes = map (f . g) x
+ tests/examples/Default2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default2.hs:1:7: Warning: Use map once\nFound:\n  map f (map g x)\nWhy not:\n  map (f . g) x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 22}, subts = [("f",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 12}),("g",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19}),("x",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21})], orig = "map (f . g) x"}])]
+ tests/examples/Default20.hs view
@@ -0,0 +1,1 @@+yes = ftable ++ map (\ (c, x) -> (toUpper c, urlEncode x)) ftable
+ tests/examples/Default20.hs.expected view
@@ -0,0 +1,1 @@+yes = ftable ++ map (toUpper Control.Arrow.*** urlEncode) ftable
+ tests/examples/Default20.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default20.hs:1:22: Warning: Use ***\nFound:\n  \\ (c, x) -> (toUpper c, urlEncode x)\nWhy not:\n  toUpper Control.Arrow.*** urlEncode\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 58}, subts = [("f",SrcSpan {startLine = 1, startCol = 35, endLine = 1, endCol = 42}),("g",SrcSpan {startLine = 1, startCol = 46, endLine = 1, endCol = 55})], orig = "f Control.Arrow.*** g"}])]
+ tests/examples/Default21.hs view
@@ -0,0 +1,1 @@+yes = map (\(a,b) -> a) xs
+ tests/examples/Default21.hs.expected view
@@ -0,0 +1,1 @@+yes = map (fst) xs
+ tests/examples/Default21.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default21.hs:1:12: Error: Use fst\nFound:\n  \\ (a, b) -> a\nWhy not:\n  fst\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 23}, subts = [], orig = "fst"}])]
+ tests/examples/Default22.hs view
@@ -0,0 +1,1 @@+yes = map (\(a,_) -> a) xs
+ tests/examples/Default22.hs.expected view
@@ -0,0 +1,1 @@+yes = map (fst) xs
+ tests/examples/Default22.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default22.hs:1:12: Error: Use fst\nFound:\n  \\ (a, _) -> a\nWhy not:\n  fst\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 23}, subts = [], orig = "fst"}])]
+ tests/examples/Default23.hs view
@@ -0,0 +1,1 @@+yes = readFile $ args !! 0
+ tests/examples/Default23.hs.expected view
@@ -0,0 +1,1 @@+yes = readFile $ head args
+ tests/examples/Default23.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default23.hs:1:18: Warning: Use head\nFound:\n  args !! 0\nWhy not:\n  head args\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 27}, subts = [("x",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 22})], orig = "head x"}])]
+ tests/examples/Default24.hs view
@@ -0,0 +1,1 @@+yes = if Debug `elem` opts then ["--debug"] else []
+ tests/examples/Default24.hs.expected view
@@ -0,0 +1,1 @@+yes = ["--debug" | Debug `elem` opts]
+ tests/examples/Default24.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default24.hs:1:7: Warning: Use list comprehension\nFound:\n  if Debug `elem` opts then [\"--debug\"] else []\nWhy not:\n  [\"--debug\" | Debug `elem` opts]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 52}, subts = [("b",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 27}),("x",SrcSpan {startLine = 1, startCol = 34, endLine = 1, endCol = 43})], orig = "[x | b]"}])]
+ tests/examples/Default25.hs view
@@ -0,0 +1,2 @@+yes = qux (if nullPS s then return False else if headPS s /= '\n' then return False else alter_input tailPS >> return True )+
+ tests/examples/Default25.hs.expected view
@@ -0,0 +1,2 @@+yes = qux (if nullPS s || (headPS s /= '\n') then return False else alter_input tailPS >> return True )+
+ tests/examples/Default25.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default25.hs:1:12: Error: Redundant if\nFound:\n  if nullPS s then return False else\n    if headPS s /= '\\n' then return False else\n      alter_input tailPS >> return True\nWhy not:\n  if nullPS s || (headPS s /= '\\n') then return False else\n    alter_input tailPS >> return True\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 123}, subts = [("a",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 23}),("b",SrcSpan {startLine = 1, startCol = 50, endLine = 1, endCol = 66}),("f",SrcSpan {startLine = 1, startCol = 90, endLine = 1, endCol = 123}),("t",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 41})], orig = "if a || (b) then t else f"}])]
+ tests/examples/Default26.hs view
@@ -0,0 +1,2 @@+yes = if foo then do stuff; moreStuff; lastOfTheStuff else return () +   
+ tests/examples/Default26.hs.expected view
@@ -0,0 +1,2 @@+yes = Control.Monad.when foo $ do stuff; moreStuff; lastOfTheStuff+
+ tests/examples/Default26.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default26.hs:1:7: Error: Use when\nFound:\n  if foo then\n    do stuff\n       moreStuff\n       lastOfTheStuff\n    else return ()\nWhy not:\n  Control.Monad.when foo $\n    do stuff\n       moreStuff\n       lastOfTheStuff\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 69}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 13}),("y",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 54})], orig = "Control.Monad.when x $ y"}])]
+ tests/examples/Default27.hs view
@@ -0,0 +1,1 @@+yes = if foo then stuff else return ()
+ tests/examples/Default27.hs.expected view
@@ -0,0 +1,1 @@+yes = Control.Monad.when foo stuff
+ tests/examples/Default27.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default27.hs:1:7: Error: Use when\nFound:\n  if foo then stuff else return ()\nWhy not:\n  Control.Monad.when foo stuff\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 39}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 13}),("y",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 24})], orig = "Control.Monad.when x y"}])]
+ tests/examples/Default28.hs view
@@ -0,0 +1,1 @@+yes = foo $ \(a, b) -> (a, y + b)
+ tests/examples/Default28.hs.expected view
@@ -0,0 +1,1 @@+yes = foo $ Control.Arrow.second ((+) y)
+ tests/examples/Default28.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default28.hs:1:13: Warning: Use second\nFound:\n  \\ (a, b) -> (a, y + b)\nWhy not:\n  Control.Arrow.second ((+) y)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 34}, subts = [], orig = "Control.Arrow.second ((+) y)"}])]
+ tests/examples/Default29.hs view
@@ -0,0 +1,1 @@+no  = foo $ \(a, b) -> (a, a + b)
+ tests/examples/Default29.hs.expected view
@@ -0,0 +1,1 @@+no  = foo $ \(a, b) -> (a, a + b)
+ tests/examples/Default29.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default3.hs view
@@ -0,0 +1,1 @@+yes = concat.map (\x->if x==e then l' else [x])
+ tests/examples/Default3.hs.expected view
@@ -0,0 +1,1 @@+yes = concatMap (\x->if x==e then l' else [x])
+ tests/examples/Default3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default3.hs:1:7: Error: Use concatMap\nFound:\n  concat . map (\\ x -> if x == e then l' else [x])\nWhy not:\n  concatMap (\\ x -> if x == e then l' else [x])\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 48}, subts = [("f",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 48})], orig = "concatMap f"}])]
+ tests/examples/Default30.hs view
@@ -0,0 +1,1 @@+yes = map (uncurry (+)) $ zip [1 .. 5] [6 .. 10]
+ tests/examples/Default30.hs.expected view
@@ -0,0 +1,1 @@+yes = zipWith (+) [1 .. 5] [6 .. 10]
+ tests/examples/Default30.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default30.hs:1:7: Error: Use zipWith\nFound:\n  map (uncurry (+)) $ zip [1 .. 5] [6 .. 10]\nWhy not:\n  zipWith (+) [1 .. 5] [6 .. 10]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 49}, subts = [("f",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 23}),("x",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 39}),("y",SrcSpan {startLine = 1, startCol = 40, endLine = 1, endCol = 49})], orig = "zipWith f x y"}])]
+ tests/examples/Default31.hs view
@@ -0,0 +1,1 @@+no = do iter <- textBufferGetTextIter tb ; textBufferSelectRange tb iter iter
+ tests/examples/Default31.hs.expected view
@@ -0,0 +1,1 @@+no = do iter <- textBufferGetTextIter tb ; textBufferSelectRange tb iter iter
+ tests/examples/Default31.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default32.hs view
@@ -0,0 +1,1 @@+no = flip f x $ \y -> y*y+y
+ tests/examples/Default32.hs.expected view
@@ -0,0 +1,1 @@+no = flip f x $ \y -> y*y+y
+ tests/examples/Default32.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default33.hs view
@@ -0,0 +1,1 @@+no = \x -> f x (g x)
+ tests/examples/Default33.hs.expected view
@@ -0,0 +1,1 @@+no x = f x (g x)
+ tests/examples/Default33.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default33.hs:1:1: Error: Redundant lambda\nFound:\n  no = \\ x -> f x (g x)\nWhy not:\n  no x = f x (g x)\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 21}, subts = [("body",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 21}),("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8})], orig = "no a = body"}])]
+ tests/examples/Default34.hs view
@@ -0,0 +1,1 @@+no = foo (\ v -> f v . g)
+ tests/examples/Default34.hs.expected view
@@ -0,0 +1,1 @@+no = foo (\ v -> f v . g)
+ tests/examples/Default34.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default35.hs view
@@ -0,0 +1,1 @@+yes = concat . intersperse " "
+ tests/examples/Default35.hs.expected view
@@ -0,0 +1,1 @@+yes = unwords
+ tests/examples/Default35.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default35.hs:1:7: Warning: Use unwords\nFound:\n  concat . intersperse \" \"\nWhy not:\n  unwords\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 31}, subts = [], orig = "unwords"}])]
+ tests/examples/Default36.hs view
@@ -0,0 +1,1 @@+yes = Prelude.concat $ intersperse " " xs
+ tests/examples/Default36.hs.expected view
@@ -0,0 +1,1 @@+yes = unwords xs
+ tests/examples/Default36.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default36.hs:1:7: Warning: Use unwords\nFound:\n  Prelude.concat $ intersperse \" \" xs\nWhy not:\n  unwords xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 42}, subts = [("x",SrcSpan {startLine = 1, startCol = 40, endLine = 1, endCol = 42})], orig = "unwords x"}])]
+ tests/examples/Default37.hs view
@@ -0,0 +1,1 @@+yes = concat $ Data.List.intersperse " " xs
+ tests/examples/Default37.hs.expected view
@@ -0,0 +1,1 @@+yes = unwords xs
+ tests/examples/Default37.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default37.hs:1:7: Warning: Use unwords\nFound:\n  concat $ Data.List.intersperse \" \" xs\nWhy not:\n  unwords xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 44}, subts = [("x",SrcSpan {startLine = 1, startCol = 42, endLine = 1, endCol = 44})], orig = "unwords x"}])]
+ tests/examples/Default38.hs view
@@ -0,0 +1,1 @@+yes = if a then True else False
+ tests/examples/Default38.hs.expected view
@@ -0,0 +1,1 @@+yes = a
+ tests/examples/Default38.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default38.hs:1:7: Error: Redundant if\nFound:\n  if a then True else False\nWhy not:\n  a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 32}, subts = [("a",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11})], orig = "a"}])]
+ tests/examples/Default39.hs view
@@ -0,0 +1,1 @@+yes = if x then true else False
+ tests/examples/Default39.hs.expected view
@@ -0,0 +1,1 @@+yes = x && true
+ tests/examples/Default39.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default39.hs:1:7: Error: Redundant if\nFound:\n  if x then true else False\nWhy not:\n  x && true\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 32}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11}),("y",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 21})], orig = "x && y"}])]
+ tests/examples/Default4.hs view
@@ -0,0 +1,1 @@+yes = f x where f x = concat . map head
+ tests/examples/Default4.hs.expected view
@@ -0,0 +1,1 @@+yes = f x where f x = concatMap head
+ tests/examples/Default4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default4.hs:1:23: Error: Use concatMap\nFound:\n  concat . map head\nWhy not:\n  concatMap head\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 40}, subts = [("f",SrcSpan {startLine = 1, startCol = 36, endLine = 1, endCol = 40})], orig = "concatMap f"}])]
+ tests/examples/Default40.hs view
@@ -0,0 +1,1 @@+yes = elem x y
+ tests/examples/Default40.hs.expected view
@@ -0,0 +1,1 @@+yes = x `elem` y
+ tests/examples/Default40.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default40.hs:1:7: Warning: Use infix\nFound:\n  elem x y\nWhy not:\n  x `elem` y\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 15}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 13}),("y",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 15})], orig = "x `elem` y"}])]
+ tests/examples/Default41.hs view
@@ -0,0 +1,1 @@+yes = foo (elem x y)
+ tests/examples/Default41.hs.expected view
@@ -0,0 +1,1 @@+yes = foo (x `elem` y)
+ tests/examples/Default41.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default41.hs:1:12: Warning: Use infix\nFound:\n  elem x y\nWhy not:\n  x `elem` y\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 20}, subts = [("x",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18}),("y",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 20})], orig = "x `elem` y"}])]
+ tests/examples/Default42.hs view
@@ -0,0 +1,1 @@+no  = x `elem` y
+ tests/examples/Default42.hs.expected view
@@ -0,0 +1,1 @@+no  = x `elem` y
+ tests/examples/Default42.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default43.hs view
@@ -0,0 +1,1 @@+no  = elem 1 [] : []
+ tests/examples/Default43.hs.expected view
@@ -0,0 +1,1 @@+no  = [elem 1 []]
+ tests/examples/Default43.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default43.hs:1:7: Warning: Use list literal\nFound:\n  elem 1 [] : []\nWhy not:\n  [elem 1 []]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 21}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 16})], orig = "[a]"}])]
+ tests/examples/Default44.hs view
@@ -0,0 +1,1 @@+test a = foo (\x -> True)
+ tests/examples/Default44.hs.expected view
@@ -0,0 +1,1 @@+test a = foo (const True)
+ tests/examples/Default44.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default44.hs:1:15: Warning: Use const\nFound:\n  \\ x -> True\nWhy not:\n  const True\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 25}, subts = [("y",SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 25})], orig = "const y"}])]
+ tests/examples/Default45.hs view
@@ -0,0 +1,1 @@+h a = flip f x (y z)
+ tests/examples/Default45.hs.expected view
@@ -0,0 +1,1 @@+h a = f (y z) x
+ tests/examples/Default45.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default45.hs:1:7: Error: Redundant flip\nFound:\n  flip f x (y z)\nWhy not:\n  f (y z) x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 21}, subts = [("f",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 13}),("x",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 15}),("y",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 21})], orig = "f y x"}])]
+ tests/examples/Default46.hs view
@@ -0,0 +1,1 @@+h a = flip f x $ y z
+ tests/examples/Default46.hs.expected view
@@ -0,0 +1,1 @@+h a = flip f x $ y z
+ tests/examples/Default46.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default47.hs view
@@ -0,0 +1,1 @@+yes x = case x of {True -> a ; False -> b}
+ tests/examples/Default47.hs.expected view
@@ -0,0 +1,1 @@+yes x = if x then a else b
+ tests/examples/Default47.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default47.hs:1:9: Warning: Use if\nFound:\n  case x of\n      True -> a\n      False -> b\nWhy not:\n  if x then a else b\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 43}, subts = [("a",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 15}),("f",SrcSpan {startLine = 1, startCol = 41, endLine = 1, endCol = 42}),("t",SrcSpan {startLine = 1, startCol = 28, endLine = 1, endCol = 29})], orig = "if a then t else f"}])]
+ tests/examples/Default48.hs view
@@ -0,0 +1,1 @@+yes x = case x of {False -> a ; _ -> b}
+ tests/examples/Default48.hs.expected view
@@ -0,0 +1,1 @@+yes x = if x then b else a
+ tests/examples/Default48.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default48.hs:1:9: Warning: Use if\nFound:\n  case x of\n      False -> a\n      _ -> b\nWhy not:\n  if x then b else a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 40}, subts = [("a",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 15}),("f",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 30}),("t",SrcSpan {startLine = 1, startCol = 38, endLine = 1, endCol = 39})], orig = "if a then t else f"}])]
+ tests/examples/Default49.hs view
@@ -0,0 +1,1 @@+no = const . ok . toResponse $ "saved"
+ tests/examples/Default49.hs.expected view
@@ -0,0 +1,1 @@+no = const . ok . toResponse $ "saved"
+ tests/examples/Default49.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default5.hs view
@@ -0,0 +1,1 @@+yes = concat . map f . g
+ tests/examples/Default5.hs.expected view
@@ -0,0 +1,1 @@+yes = concatMap f . g
+ tests/examples/Default5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default5.hs:1:7: Error: Use concatMap\nFound:\n  concat . map f . g\nWhy not:\n  concatMap f . g\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 25}, subts = [("f",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21}),("x",SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 25})], orig = "concatMap f . x"}])]
+ tests/examples/Default50.hs view
@@ -0,0 +1,1 @@+yes = case x z of Nothing -> y z; Just pat -> pat
+ tests/examples/Default50.hs.expected view
@@ -0,0 +1,1 @@+yes = fromMaybe (y z) (x z)
+ tests/examples/Default50.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default50.hs:1:7: Warning: Use fromMaybe\nFound:\n  case x z of\n      Nothing -> y z\n      Just pat -> pat\nWhy not:\n  fromMaybe (y z) (x z)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 50}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 15}),("y",SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 33})], orig = "fromMaybe (y) (x)"}])]
+ tests/examples/Default51.hs view
@@ -0,0 +1,1 @@+yes = if p then s else return ()
+ tests/examples/Default51.hs.expected view
@@ -0,0 +1,1 @@+yes = Control.Monad.when p s
+ tests/examples/Default51.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default51.hs:1:7: Error: Use when\nFound:\n  if p then s else return ()\nWhy not:\n  Control.Monad.when p s\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 33}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11}),("y",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18})], orig = "Control.Monad.when x y"}])]
+ tests/examples/Default52.hs view
@@ -0,0 +1,1 @@+error = a $$$$ b $$$$ c ==> a . b $$$$$ c
+ tests/examples/Default52.hs.expected view
@@ -0,0 +1,1 @@+error = a $$$$ b $$$$ c ==> a . b $$$$$ c
+ tests/examples/Default52.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default53.hs view
@@ -0,0 +1,1 @@+yes = when (not . null $ asdf)
+ tests/examples/Default53.hs.expected view
@@ -0,0 +1,1 @@+yes = unless (null asdf)
+ tests/examples/Default53.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default53.hs:1:7: Error: Use unless\nFound:\n  when (not . null $ asdf)\nWhy not:\n  unless (null asdf)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 31}, subts = [], orig = "unless (null asdf)"}])]
+ tests/examples/Default54.hs view
@@ -0,0 +1,1 @@+yes = id 1
+ tests/examples/Default54.hs.expected view
@@ -0,0 +1,1 @@+yes = 1
+ tests/examples/Default54.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default54.hs:1:7: Error: Evaluate\nFound:\n  id 1\nWhy not:\n  1\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 11}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11})], orig = "x"}])]
+ tests/examples/Default55.hs view
@@ -0,0 +1,1 @@+yes = case concat (map f x) of [] -> []
+ tests/examples/Default55.hs.expected view
@@ -0,0 +1,1 @@+yes = case concatMap f x of [] -> []
+ tests/examples/Default55.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default55.hs:1:12: Error: Use concatMap\nFound:\n  concat (map f x)\nWhy not:\n  concatMap f x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 28}, subts = [("f",SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 25}),("x",SrcSpan {startLine = 1, startCol = 26, endLine = 1, endCol = 27})], orig = "concatMap f x"}])]
+ tests/examples/Default56.hs view
@@ -0,0 +1,1 @@+yes = [v | v <- xs]
+ tests/examples/Default56.hs.expected view
@@ -0,0 +1,1 @@+yes = xs
+ tests/examples/Default56.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default56.hs:1:7: Warning: Redundant list comprehension\nFound:\n  [v | v <- xs]\nWhy not:\n  xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 20}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9}),("y",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 19})], orig = "y"}])]
+ tests/examples/Default57.hs view
@@ -0,0 +1,1 @@+no  = [Left x | Left x <- xs]
+ tests/examples/Default57.hs.expected view
@@ -0,0 +1,1 @@+no  = [Left x | Left x <- xs]
+ tests/examples/Default57.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default58.hs view
@@ -0,0 +1,1 @@+when p s = if p then s else return ()
+ tests/examples/Default58.hs.expected view
@@ -0,0 +1,1 @@+when p s = if p then s else return ()
+ tests/examples/Default58.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default59.hs view
@@ -0,0 +1,1 @@+no = x ^^ 18.5
+ tests/examples/Default59.hs.expected view
@@ -0,0 +1,1 @@+no = x ^^ 18.5
+ tests/examples/Default59.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default6.hs view
@@ -0,0 +1,1 @@+yes = concat $ map f x
+ tests/examples/Default6.hs.expected view
@@ -0,0 +1,1 @@+yes = concatMap f x
+ tests/examples/Default6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default6.hs:1:7: Error: Use concatMap\nFound:\n  concat $ map f x\nWhy not:\n  concatMap f x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 23}, subts = [("f",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21}),("x",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "concatMap f x"}])]
+ tests/examples/Default60.hs view
@@ -0,0 +1,1 @@+instance Arrow (->) where first f = f *** id
+ tests/examples/Default60.hs.expected view
@@ -0,0 +1,1 @@+instance Arrow (->) where first f = f *** id
+ tests/examples/Default60.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default61.hs view
@@ -0,0 +1,1 @@+yes = fromInteger 12
+ tests/examples/Default61.hs.expected view
@@ -0,0 +1,1 @@+yes = 12
+ tests/examples/Default61.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default61.hs:1:7: Error: Redundant fromInteger\nFound:\n  fromInteger 12\nWhy not:\n  12\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 21}, subts = [("x",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 21})], orig = "x"}])]
+ tests/examples/Default62.hs view
@@ -0,0 +1,1 @@+import Prelude hiding (catch); no = catch
+ tests/examples/Default62.hs.expected view
@@ -0,0 +1,1 @@+import Prelude hiding (catch); no = catch
+ tests/examples/Default62.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default63.hs view
@@ -0,0 +1,1 @@+import Control.Exception as E; no = E.catch
+ tests/examples/Default63.hs.expected view
@@ -0,0 +1,1 @@+import Control.Exception as E; no = E.catch
+ tests/examples/Default63.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default64.hs view
@@ -0,0 +1,1 @@+main = do f; putStrLn $ show x
+ tests/examples/Default64.hs.expected view
@@ -0,0 +1,1 @@+main = do f; print x
+ tests/examples/Default64.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default64.hs:1:14: Error: Use print\nFound:\n  putStrLn $ show x\nWhy not:\n  print x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 31}, subts = [("x",SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 31})], orig = "print x"}])]
+ tests/examples/Default65.hs view
@@ -0,0 +1,1 @@+main = map (writer,) $ map arcObj $ filter (rdfPredEq (Res dctreferences)) ts
+ tests/examples/Default65.hs.expected view
@@ -0,0 +1,1 @@+main = map ((writer,) . arcObj) (filter (rdfPredEq (Res dctreferences)) ts)
+ tests/examples/Default65.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default65.hs:1:8: Warning: Use map once\nFound:\n  map (writer,) $\n    map arcObj $ filter (rdfPredEq (Res dctreferences)) ts\nWhy not:\n  map ((writer,) . arcObj)\n    (filter (rdfPredEq (Res dctreferences)) ts)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 78}, subts = [("f",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 21}),("g",SrcSpan {startLine = 1, startCol = 28, endLine = 1, endCol = 34}),("x",SrcSpan {startLine = 1, startCol = 37, endLine = 1, endCol = 78})], orig = "map (f . g) (x)"}])]
+ tests/examples/Default66.hs view
@@ -0,0 +1,1 @@+h x y = return $! (x, y)
+ tests/examples/Default66.hs.expected view
@@ -0,0 +1,1 @@+h x y = return (x, y)
+ tests/examples/Default66.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default66.hs:1:9: Error: Redundant $!\nFound:\n  return $! (x, y)\nWhy not:\n  return (x, y)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 25}, subts = [("f",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 15}),("x",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 25})], orig = "f x"}])]
+ tests/examples/Default67.hs view
@@ -0,0 +1,1 @@+h x y = return $! x
+ tests/examples/Default67.hs.expected view
@@ -0,0 +1,1 @@+h x y = return $! x
+ tests/examples/Default67.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default68.hs view
@@ -0,0 +1,1 @@+getInt = do { x <- readIO "0"; return $! (x :: Int) }
+ tests/examples/Default68.hs.expected view
@@ -0,0 +1,1 @@+getInt = do { x <- readIO "0"; return $! (x :: Int) }
+ tests/examples/Default68.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default69.hs view
@@ -0,0 +1,1 @@+foo = evaluate [12]
+ tests/examples/Default69.hs.expected view
@@ -0,0 +1,1 @@+foo = return [12]
+ tests/examples/Default69.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default69.hs:1:7: Error: Redundant evaluate\nFound:\n  evaluate [12]\nWhy not:\n  return [12]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 20}, subts = [("x",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 20})], orig = "return x"}])]
+ tests/examples/Default7.hs view
@@ -0,0 +1,1 @@+yes = "test" ++ concatMap (' ':) ["of","this"]
+ tests/examples/Default7.hs.expected view
@@ -0,0 +1,1 @@+yes = unwords ("test" : ["of","this"])
+ tests/examples/Default7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default7.hs:1:7: Error: Use unwords\nFound:\n  \"test\" ++ concatMap (' ' :) [\"of\", \"this\"]\nWhy not:\n  unwords (\"test\" : [\"of\", \"this\"])\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 47}, subts = [("x",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 13}),("y",SrcSpan {startLine = 1, startCol = 34, endLine = 1, endCol = 47})], orig = "unwords (x : y)"}])]
+ tests/examples/Default70.hs view
@@ -0,0 +1,1 @@+test = qux (\ a -> f a >>= \ b -> return (a, b))
+ tests/examples/Default70.hs.expected view
@@ -0,0 +1,1 @@+test = qux (\ a -> f a >>= \ b -> return (a, b))
+ tests/examples/Default70.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default71.hs view
@@ -0,0 +1,1 @@+fooer input = catMaybes . map Just $ input
+ tests/examples/Default71.hs.expected view
@@ -0,0 +1,1 @@+fooer input = mapMaybe Just $ input
+ tests/examples/Default71.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default71.hs:1:15: Error: Use mapMaybe\nFound:\n  catMaybes . map Just\nWhy not:\n  mapMaybe Just\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 35}, subts = [("f",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 35})], orig = "mapMaybe f"}])]
+ tests/examples/Default72.hs view
@@ -0,0 +1,1 @@+yes = mapMaybe id
+ tests/examples/Default72.hs.expected view
@@ -0,0 +1,1 @@+yes = catMaybes
+ tests/examples/Default72.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default72.hs:1:7: Error: Use catMaybes\nFound:\n  mapMaybe id\nWhy not:\n  catMaybes\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 18}, subts = [], orig = "catMaybes"}])]
+ tests/examples/Default73.hs view
@@ -0,0 +1,1 @@+main = print $ map (\_->5) [2,3,5]
+ tests/examples/Default73.hs.expected view
@@ -0,0 +1,1 @@+main = print $ map (const 5) [2,3,5]
+ tests/examples/Default73.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default73.hs:1:21: Warning: Use const\nFound:\n  \\ _ -> 5\nWhy not:\n  const 5\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 26}, subts = [("y",SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 26})], orig = "const y"}])]
+ tests/examples/Default74.hs view
@@ -0,0 +1,1 @@+main = head $ drop n x
+ tests/examples/Default74.hs.expected view
@@ -0,0 +1,1 @@+main = head $ drop n x
+ tests/examples/Default74.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default75.hs view
@@ -0,0 +1,1 @@+main = head $ drop (-3) x
+ tests/examples/Default75.hs.expected view
@@ -0,0 +1,1 @@+main = head $ x
+ tests/examples/Default75.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default75.hs:1:15: Error: Drop on a non-positive\nFound:\n  drop (-3) x\nWhy not:\n  x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 26}, subts = [("i",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 24}),("x",SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 26})], orig = "x"}])]
+ tests/examples/Default76.hs view
@@ -0,0 +1,1 @@+main = head $ drop 2 x
+ tests/examples/Default76.hs.expected view
@@ -0,0 +1,1 @@+main = x !! 2
+ tests/examples/Default76.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default76.hs:1:8: Error: Use !!\nFound:\n  head $ drop 2 x\nWhy not:\n  x !! 2\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 23}, subts = [("n",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21}),("x",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "x !! n"}])]
+ tests/examples/Default77.hs view
@@ -0,0 +1,1 @@+main = drop 0 x
+ tests/examples/Default77.hs.expected view
@@ -0,0 +1,1 @@+main = x
+ tests/examples/Default77.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default77.hs:1:8: Error: Drop on a non-positive\nFound:\n  drop 0 x\nWhy not:\n  x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 16}, subts = [("i",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 14}),("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 16})], orig = "x"}])]
+ tests/examples/Default78.hs view
@@ -0,0 +1,1 @@+main = take 0 x
+ tests/examples/Default78.hs.expected view
@@ -0,0 +1,1 @@+main = []
+ tests/examples/Default78.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default78.hs:1:8: Error: Take on a non-positive\nFound:\n  take 0 x\nWhy not:\n  []\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 16}, subts = [("i",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 14}),("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 16})], orig = "[]"}])]
+ tests/examples/Default79.hs view
@@ -0,0 +1,1 @@+main = take (-5) x
+ tests/examples/Default79.hs.expected view
@@ -0,0 +1,1 @@+main = []
+ tests/examples/Default79.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default79.hs:1:8: Error: Take on a non-positive\nFound:\n  take (-5) x\nWhy not:\n  []\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 19}, subts = [("i",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 17}),("x",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 19})], orig = "[]"}])]
+ tests/examples/Default8.hs view
@@ -0,0 +1,1 @@+yes = if f a then True else b
+ tests/examples/Default8.hs.expected view
@@ -0,0 +1,1 @@+yes = f a || b
+ tests/examples/Default8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default8.hs:1:7: Error: Redundant if\nFound:\n  if f a then True else b\nWhy not:\n  f a || b\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 30}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 13}),("y",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 30})], orig = "x || y"}])]
+ tests/examples/Default80.hs view
@@ -0,0 +1,1 @@+main = take (-y) x
+ tests/examples/Default80.hs.expected view
@@ -0,0 +1,1 @@+main = take (-y) x
+ tests/examples/Default80.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default81.hs view
@@ -0,0 +1,1 @@+main = take 4 x
+ tests/examples/Default81.hs.expected view
@@ -0,0 +1,1 @@+main = take 4 x
+ tests/examples/Default81.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default82.hs view
@@ -0,0 +1,1 @@+main = let (first, rest) = (takeWhile p l, dropWhile p l) in rest
+ tests/examples/Default82.hs.expected view
@@ -0,0 +1,1 @@+main = let (first, rest) = span p l in rest
+ tests/examples/Default82.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default82.hs:1:28: Error: Use span\nFound:\n  (takeWhile p l, dropWhile p l)\nWhy not:\n  span p l\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 28, endLine = 1, endCol = 58}, subts = [("p",SrcSpan {startLine = 1, startCol = 39, endLine = 1, endCol = 40}),("x",SrcSpan {startLine = 1, startCol = 41, endLine = 1, endCol = 42})], orig = "span p x"}])]
+ tests/examples/Default83.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-}+main = map $ \ d -> ([| $d |], [| $d |])
+ tests/examples/Default83.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-}+main = map $ \ d -> ([| $d |], [| $d |])
+ tests/examples/Default83.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default84.hs view
@@ -0,0 +1,1 @@+pairs (x:xs) = map (\y -> (x,y)) xs ++ pairs xs
+ tests/examples/Default84.hs.expected view
@@ -0,0 +1,1 @@+pairs (x:xs) = map (\y -> (x,y)) xs ++ pairs xs
+ tests/examples/Default84.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default85.hs view
@@ -0,0 +1,1 @@+{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
+ tests/examples/Default85.hs.expected view
@@ -0,0 +1,1 @@+{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
+ tests/examples/Default85.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default86.hs view
@@ -0,0 +1,1 @@+yes = fmap lines $ abc 123
+ tests/examples/Default86.hs.expected view
@@ -0,0 +1,1 @@+yes = lines Control.Applicative.<$> abc 123
+ tests/examples/Default86.hs.refact view
@@ -0,0 +1,1 @@+[("Default86.hs:1:7: Warning: Use <$>\nFound:\n  fmap lines $ abc 123\nWhy not:\n  lines Control.Applicative.<$> abc 123\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 27}, subts = [("f",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 17}),("x",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 27})], orig = "f Control.Applicative.<$> x"}])]
+ tests/examples/Default87.hs view
@@ -0,0 +1,1 @@+no = fmap lines $ abc $ def 123
+ tests/examples/Default87.hs.expected view
@@ -0,0 +1,1 @@+no = fmap lines $ abc $ def 123
+ tests/examples/Default87.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default88.hs view
@@ -0,0 +1,1 @@+test = foo . not . not
+ tests/examples/Default88.hs.expected view
@@ -0,0 +1,1 @@+test = foo . id
+ tests/examples/Default88.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default88.hs:1:14: Error: Redundant not\nFound:\n  not . not\nWhy not:\n  id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 23}, subts = [], orig = "id"}])]
+ tests/examples/Default89.hs view
@@ -0,0 +1,1 @@+test = map (not . not) xs
+ tests/examples/Default89.hs.expected view
@@ -0,0 +1,1 @@+test = map (id) xs
+ tests/examples/Default89.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default89.hs:1:13: Error: Redundant not\nFound:\n  not . not\nWhy not:\n  id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 22}, subts = [], orig = "id"}])]
+ tests/examples/Default9.hs view
@@ -0,0 +1,1 @@+yes = not (a == b)
+ tests/examples/Default9.hs.expected view
@@ -0,0 +1,1 @@+yes = a /= b
+ tests/examples/Default9.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default9.hs:1:7: Error: Use /=\nFound:\n  not (a == b)\nWhy not:\n  a /= b\nNote: incorrect if either value is NaN\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 19}, subts = [("a",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 13}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18})], orig = "a /= b"}])]
+ tests/examples/Default90.hs view
@@ -0,0 +1,1 @@+used = not . not . any (`notElem` special) . fst . derives
+ tests/examples/Default90.hs.expected view
@@ -0,0 +1,1 @@+used = any (`notElem` special) . fst . derives
+ tests/examples/Default90.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default90.hs:1:8: Error: Redundant not\nFound:\n  not . not . any (`notElem` special) . fst . derives\nWhy not:\n  any (`notElem` special) . fst . derives\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 59}, subts = [("x",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 59})], orig = "x"}])]
+ tests/examples/Default91.hs view
@@ -0,0 +1,1 @@+test = foo . id . map
+ tests/examples/Default91.hs.expected view
@@ -0,0 +1,1 @@+test = foo . map
+ tests/examples/Default91.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default91.hs:1:14: Error: Redundant id\nFound:\n  id . map\nWhy not:\n  map\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 22}, subts = [("x",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 22})], orig = "x"}])]
+ tests/examples/Default92.hs view
@@ -0,0 +1,1 @@+test = food id xs
+ tests/examples/Default92.hs.expected view
@@ -0,0 +1,1 @@+test = food id xs
+ tests/examples/Default92.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default93.hs view
@@ -0,0 +1,1 @@+yes = baz baz >> return ()
+ tests/examples/Default93.hs.expected view
@@ -0,0 +1,1 @@+yes = Control.Monad.void (baz baz)
+ tests/examples/Default93.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default93.hs:1:7: Warning: Use void\nFound:\n  baz baz >> return ()\nWhy not:\n  Control.Monad.void (baz baz)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 27}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 14})], orig = "Control.Monad.void (a)"}])]
+ tests/examples/Default94.hs view
@@ -0,0 +1,1 @@+no = foo >>= bar >>= something >>= elsee >> return ()
+ tests/examples/Default94.hs.expected view
@@ -0,0 +1,1 @@+no = foo >>= bar >>= something >>= elsee >> return ()
+ tests/examples/Default94.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default95.hs view
@@ -0,0 +1,1 @@+no = f (#) x
+ tests/examples/Default95.hs.expected view
@@ -0,0 +1,1 @@+no = f (#) x
+ tests/examples/Default95.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default96.hs view
@@ -0,0 +1,1 @@+data Pair = P {a :: !Int}; foo = return $! P{a=undefined}
+ tests/examples/Default96.hs.expected view
@@ -0,0 +1,1 @@+data Pair = P {a :: !Int}; foo = return $! P{a=undefined}
+ tests/examples/Default96.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default97.hs view
@@ -0,0 +1,1 @@+data Pair = P {a :: !Int}; foo = return $! P undefined
+ tests/examples/Default97.hs.expected view
@@ -0,0 +1,1 @@+data Pair = P {a :: !Int}; foo = return $! P undefined
+ tests/examples/Default97.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Default98.hs view
@@ -0,0 +1,1 @@+foo = return $! Just undefined
+ tests/examples/Default98.hs.expected view
@@ -0,0 +1,1 @@+foo = return (Just undefined)
+ tests/examples/Default98.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default98.hs:1:7: Error: Redundant $!\nFound:\n  return $! Just undefined\nWhy not:\n  return (Just undefined)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 31}, subts = [("f",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 13}),("x",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 31})], orig = "f (x)"}])]
+ tests/examples/Default99.hs view
@@ -0,0 +1,1 @@+foo = return $! (a,b)
+ tests/examples/Default99.hs.expected view
@@ -0,0 +1,1 @@+foo = return (a,b)
+ tests/examples/Default99.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Default99.hs:1:7: Error: Redundant $!\nFound:\n  return $! (a, b)\nWhy not:\n  return (a, b)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 22}, subts = [("f",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 13}),("x",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 22})], orig = "f x"}])]
+ tests/examples/Dollar0.hs view
@@ -0,0 +1,1 @@+yes = concat $ concat $ map f x
+ tests/examples/Dollar0.hs.expected view
@@ -0,0 +1,1 @@+yes = concat $ concatMap f x
+ tests/examples/Dollar0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Dollar0.hs:1:16: Error: Use concatMap\nFound:\n  concat $ map f x\nWhy not:\n  concatMap f x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 32}, subts = [("f",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 30}),("x",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 32})], orig = "concatMap f x"}])]
+ tests/examples/Duplicate0.hs view
@@ -0,0 +1,1 @@+main = do a; a; a; a
+ tests/examples/Duplicate0.hs.expected view
@@ -0,0 +1,1 @@+main = do a; a; a; a
+ tests/examples/Duplicate0.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Duplicate1.hs view
@@ -0,0 +1,1 @@+main = do a; a; a; a; a; a
+ tests/examples/Duplicate1.hs.expected view
@@ -0,0 +1,1 @@+main = do a; a; a; a; a; a
+ tests/examples/Duplicate1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Duplicate1.hs:1:11: Warning: Reduce duplication\nFound:\n  a\n  a\n  a\nWhy not:\n  Combine with tests/examples/Duplicate1.hs:1:20\n",[])]
+ tests/examples/Duplicate2.hs view
@@ -0,0 +1,1 @@+main = do a; a; a; a; a; a; a
+ tests/examples/Duplicate2.hs.expected view
@@ -0,0 +1,1 @@+main = do a; a; a; a; a; a; a
+ tests/examples/Duplicate2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Duplicate2.hs:1:11: Warning: Reduce duplication\nFound:\n  a\n  a\n  a\nWhy not:\n  Combine with tests/examples/Duplicate2.hs:1:20\n",[])]
+ tests/examples/Duplicate3.hs view
@@ -0,0 +1,1 @@+main = do (do b; a; a; a); do (do c; a; a; a)
+ tests/examples/Duplicate3.hs.expected view
@@ -0,0 +1,1 @@+main = do do b; a; a; a; (do c; a; a; a)
+ tests/examples/Duplicate3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Duplicate3.hs:1:8: Warning: Redundant bracket\nFound:\n  do (do b\n         a\n         a\n         a)\n     do (do c\n            a\n            a\n            a)\nWhy not:\n  do do b\n        a\n        a\n        a\n     do (do c\n            a\n            a\n            a)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 26}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 25})], orig = "x"}]),("tests/examples/Duplicate3.hs:1:18: Warning: Reduce duplication\nFound:\n  a\n  a\n  a\nWhy not:\n  Combine with tests/examples/Duplicate3.hs:1:38\n",[]),("tests/examples/Duplicate3.hs:1:28: Error: Redundant do\nFound:\n  do (do c\n         a\n         a\n         a)\nWhy not:\n  (do c\n      a\n      a\n      a)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 28, endLine = 1, endCol = 46}, subts = [("y",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 46})], orig = "y"}]),("tests/examples/Duplicate3.hs:1:28: Warning: Redundant bracket\nFound:\n  do (do c\n         a\n         a\n         a)\nWhy not:\n  do do c\n        a\n        a\n        a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 46}, subts = [("x",SrcSpan {startLine = 1, startCol = 32, endLine = 1, endCol = 45})], orig = "x"}])]
+ tests/examples/Duplicate4.hs view
@@ -0,0 +1,1 @@+main = do a; a; a; b; a; a; a
+ tests/examples/Duplicate4.hs.expected view
@@ -0,0 +1,1 @@+main = do a; a; a; b; a; a; a
+ tests/examples/Duplicate4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Duplicate4.hs:1:11: Warning: Reduce duplication\nFound:\n  a\n  a\n  a\nWhy not:\n  Combine with tests/examples/Duplicate4.hs:1:23\n",[])]
+ tests/examples/Duplicate5.hs view
@@ -0,0 +1,1 @@+main = do a; a; a; b; a; a
+ tests/examples/Duplicate5.hs.expected view
@@ -0,0 +1,1 @@+main = do a; a; a; b; a; a
+ tests/examples/Duplicate5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Duplicate6.hs view
@@ -0,0 +1,1 @@+foo = a where {a = 1; b = 2; c = 3}; bar = a where {a = 1; b = 2; c = 3}
+ tests/examples/Duplicate6.hs.expected view
@@ -0,0 +1,1 @@+foo = a where {a = 1; b = 2; c = 3}; bar = a where {a = 1; b = 2; c = 3}
+ tests/examples/Duplicate6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Duplicate6.hs:1:16: Warning: Reduce duplication\nFound:\n  a = 1\n  b = 2\n  c = 3\nWhy not:\n  Combine with tests/examples/Duplicate6.hs:1:53\n",[])]
+ tests/examples/Extensions0.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE Arrows #-} +f = id
+ tests/examples/Extensions0.hs.expected view
@@ -0,0 +1,2 @@++f = id
+ tests/examples/Extensions0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions0.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE Arrows #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 24}, newComment = ""}])]
+ tests/examples/Extensions10.hs view
@@ -0,0 +1,3 @@+{-# LANGUAGE ImplicitParams, BangPatterns #-} +sort :: (?cmp :: a -> a -> Bool) => [a] -> [a] +sort !f = undefined
+ tests/examples/Extensions10.hs.expected view
@@ -0,0 +1,3 @@+{-# LANGUAGE ImplicitParams, BangPatterns #-}+sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]+sort !f = undefined
+ tests/examples/Extensions10.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions11.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE KindSignatures #-} +data Set (cxt :: * -> *) a = Set [a]
+ tests/examples/Extensions11.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE KindSignatures #-}+data Set (cxt :: * -> *) a = Set [a]
+ tests/examples/Extensions11.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions12.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecordWildCards #-} +record field = Record{..}
+ tests/examples/Extensions12.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecordWildCards #-}+record field = Record{..}
+ tests/examples/Extensions12.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions13.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecordWildCards #-} +record = 1
+ tests/examples/Extensions13.hs.expected view
@@ -0,0 +1,2 @@++record = 1
+ tests/examples/Extensions13.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions13.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE RecordWildCards #-}\nWhy not remove it.\nNote: you may need to add DisambiguateRecordFields\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 33}, newComment = ""}])]
+ tests/examples/Extensions14.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE UnboxedTuples #-} +record = 1
+ tests/examples/Extensions14.hs.expected view
@@ -0,0 +1,2 @@++record = 1
+ tests/examples/Extensions14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions14.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE UnboxedTuples #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 31}, newComment = ""}])]
+ tests/examples/Extensions15.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-} +foo
+ tests/examples/Extensions15.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-}+foo
+ tests/examples/Extensions15.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions16.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +record = 1
+ tests/examples/Extensions16.hs.expected view
@@ -0,0 +1,2 @@++record = 1
+ tests/examples/Extensions16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions16.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 64}, newComment = ""}])]
+ tests/examples/Extensions17.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +newtype Foo = Foo Int deriving Data
+ tests/examples/Extensions17.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveDataTypeable #-}+newtype Foo = Foo Int deriving Data
+ tests/examples/Extensions17.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions17.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}\nWhy not:\n  {-# LANGUAGE DeriveDataTypeable #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 64}, newComment = "{-# LANGUAGE DeriveDataTypeable #-}"}])]
+ tests/examples/Extensions18.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +data Foo = Foo Int deriving Data
+ tests/examples/Extensions18.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveDataTypeable #-}+data Foo = Foo Int deriving Data
+ tests/examples/Extensions18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions18.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}\nWhy not:\n  {-# LANGUAGE DeriveDataTypeable #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 64}, newComment = "{-# LANGUAGE DeriveDataTypeable #-}"}])]
+ tests/examples/Extensions19.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +newtype Foo = Foo Int deriving Class
+ tests/examples/Extensions19.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+newtype Foo = Foo Int deriving Class
+ tests/examples/Extensions19.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions19.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}\nWhy not:\n  {-# LANGUAGE GeneralizedNewtypeDeriving #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 64}, newComment = "{-# LANGUAGE GeneralizedNewtypeDeriving #-}"}])]
+ tests/examples/Extensions2.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GADTs, ParallelListComp, ImplicitParams #-}+f = [(a,c) | a <- b | c <- d]
+ tests/examples/Extensions2.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE GADTs, ParallelListComp #-}+f = [(a,c) | a <- b | c <- d]
+ tests/examples/Extensions2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions2.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GADTs, ParallelListComp, ImplicitParams #-}\nWhy not:\n  {-# LANGUAGE GADTs, ParallelListComp #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 57}, newComment = "{-# LANGUAGE GADTs, ParallelListComp #-}"}])]
+ tests/examples/Extensions20.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +data Foo = Foo Int deriving Class
+ tests/examples/Extensions20.hs.expected view
@@ -0,0 +1,2 @@++data Foo = Foo Int deriving Class
+ tests/examples/Extensions20.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions20.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 64}, newComment = ""}])]
+ tests/examples/Extensions21.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor #-} +data Foo = Foo Int deriving Functor
+ tests/examples/Extensions21.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor #-}+data Foo = Foo Int deriving Functor
+ tests/examples/Extensions21.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions22.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor #-} +newtype Foo = Foo Int deriving Functor
+ tests/examples/Extensions22.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor #-}+newtype Foo = Foo Int deriving Functor
+ tests/examples/Extensions22.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions23.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-} +newtype Foo = Foo Int deriving Functor
+ tests/examples/Extensions23.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+newtype Foo = Foo Int deriving Functor
+ tests/examples/Extensions23.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions24.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-} +newtype Foo = Foo Int deriving Data
+ tests/examples/Extensions24.hs.expected view
@@ -0,0 +1,2 @@++newtype Foo = Foo Int deriving Data
+ tests/examples/Extensions24.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions24.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE GeneralizedNewtypeDeriving #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 44}, newComment = ""}])]
+ tests/examples/Extensions25.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-} +deriving instance Functor Bar
+ tests/examples/Extensions25.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-}+deriving instance Functor Bar
+ tests/examples/Extensions25.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions26.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-} +deriving instance Show Bar
+ tests/examples/Extensions26.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE StandaloneDeriving #-}+deriving instance Show Bar
+ tests/examples/Extensions26.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions26.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving,\n    StandaloneDeriving #-}\nWhy not:\n  {-# LANGUAGE StandaloneDeriving #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 79}, newComment = "{-# LANGUAGE StandaloneDeriving #-}"}])]
+ tests/examples/Extensions27.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving #-} +newtype Micro = Micro Int deriving Generic
+ tests/examples/Extensions27.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DeriveGeneric #-}+newtype Micro = Micro Int deriving Generic
+ tests/examples/Extensions27.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions27.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving #-}\nWhy not:\n  {-# LANGUAGE DeriveGeneric #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 59}, newComment = "{-# LANGUAGE DeriveGeneric #-}"}])]
+ tests/examples/Extensions28.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE UnboxedTuples #-} +f :: Int -> (# Int, Int #)
+ tests/examples/Extensions28.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE UnboxedTuples #-}+f :: Int -> (# Int, Int #)
+ tests/examples/Extensions28.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions29.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE UnboxedTuples #-} +f :: x -> (x, x); f x = (x, x)
+ tests/examples/Extensions29.hs.expected view
@@ -0,0 +1,2 @@++f :: x -> (x, x); f x = (x, x)
+ tests/examples/Extensions29.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions29.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE UnboxedTuples #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 31}, newComment = ""}])]
+ tests/examples/Extensions3.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE EmptyDataDecls #-} +data Foo
+ tests/examples/Extensions3.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE EmptyDataDecls #-}+data Foo
+ tests/examples/Extensions3.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions4.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-} +$(deriveNewtypes typeInfo)
+ tests/examples/Extensions4.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-}+$(deriveNewtypes typeInfo)
+ tests/examples/Extensions4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions5.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-} +main = foo ''Bar
+ tests/examples/Extensions5.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell #-}+main = foo ''Bar
+ tests/examples/Extensions5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions6.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE PatternGuards #-} +test = case x of _ | y <- z -> w
+ tests/examples/Extensions6.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE PatternGuards #-}+test = case x of _ | y <- z -> w
+ tests/examples/Extensions6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions7.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell,EmptyDataDecls #-} +$(fmap return $ dataD (return []) (mkName "Void") [] [] [])
+ tests/examples/Extensions7.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE TemplateHaskell,EmptyDataDecls #-}+$(return Control.Applicative.<$> dataD (return []) (mkName "Void") [] [] [])
+ tests/examples/Extensions7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Extensions7.hs:2:3: Warning: Use <$>\nFound:\n  fmap return $ dataD (return []) (mkName \"Void\") [] [] []\nWhy not:\n  (return Control.Applicative.<$>\n     dataD (return []) (mkName \"Void\") [] [] [])\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 3, endLine = 2, endCol = 59}, subts = [("f",SrcSpan {startLine = 2, startCol = 8, endLine = 2, endCol = 14}),("x",SrcSpan {startLine = 2, startCol = 17, endLine = 2, endCol = 59})], orig = "f Control.Applicative.<$> x"}])]
+ tests/examples/Extensions8.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-} +main = mdo x <- y; return y
+ tests/examples/Extensions8.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-}+main = mdo x <- y; return y
+ tests/examples/Extensions8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Extensions9.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-} +main = do {rec {x <- return 1}; print x}
+ tests/examples/Extensions9.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-}+main = do {rec {x <- return 1}; print x}
+ tests/examples/Extensions9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Fixity.hs view
@@ -0,0 +1,5 @@+simple = h <$> (f $ g $ h t)++simple = h <$> (f :+ g :+ h t)++simple = h <$> (f `elem` h `elem` h)
+ tests/examples/Fixity.hs.expected view
@@ -0,0 +1,5 @@+simple = h <$> f (g $ h t)++simple = h <$> (f :+ g :+ h t)++simple = h <$> (f `elem` h `elem` h)
+ tests/examples/Fixity.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Fixity.hs:1:10: Warning: Move brackets to avoid $\nFound:\n  h <$> (f $ g $ h t)\nWhy not:\n  h <$> f (g $ h t)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 29}, subts = [("a",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18}),("b",SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 28})], orig = "a (b)"}])]
+ tests/examples/Import0.hs view
@@ -0,0 +1,1 @@+import A; import A
+ tests/examples/Import0.hs.expected view
@@ -0,0 +1,1 @@+import A;
+ tests/examples/Import0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import0.hs:1:1: Error: Use fewer imports\nFound:\n  import A\n  import A\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 19}}])]
+ tests/examples/Import1.hs view
@@ -0,0 +1,1 @@+import A; import A; import A
+ tests/examples/Import1.hs.expected view
@@ -0,0 +1,1 @@+import A;
+ tests/examples/Import1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import1.hs:1:1: Error: Use fewer imports\nFound:\n  import A\n  import A\n  import A\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 29}},Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 19}}])]
+ tests/examples/Import10.hs view
@@ -0,0 +1,1 @@+import A as A
+ tests/examples/Import10.hs.expected view
@@ -0,0 +1,1 @@+import A
+ tests/examples/Import10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import10.hs:1:1: Warning: Redundant as\nFound:\n  import A as A\nWhy not:\n  import A\n",[RemoveAsKeyword {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 14}}])]
+ tests/examples/Import11.hs view
@@ -0,0 +1,1 @@+import qualified A as A
+ tests/examples/Import11.hs.expected view
@@ -0,0 +1,1 @@+import qualified A
+ tests/examples/Import11.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import11.hs:1:1: Warning: Redundant as\nFound:\n  import qualified A as A\nWhy not:\n  import qualified A\n",[RemoveAsKeyword {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 24}}])]
+ tests/examples/Import12.hs view
@@ -0,0 +1,1 @@+import A; import B; import A
+ tests/examples/Import12.hs.expected view
@@ -0,0 +1,1 @@+import A; import B;
+ tests/examples/Import12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import12.hs:1:1: Error: Use fewer imports\nFound:\n  import A\n  import A\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 29}}])]
+ tests/examples/Import13.hs view
@@ -0,0 +1,1 @@+import qualified A; import A
+ tests/examples/Import13.hs.expected view
@@ -0,0 +1,1 @@+import qualified A; import A
+ tests/examples/Import13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import14.hs view
@@ -0,0 +1,1 @@+import B; import A; import A
+ tests/examples/Import14.hs.expected view
@@ -0,0 +1,1 @@+import B; import A;
+ tests/examples/Import14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import14.hs:1:11: Error: Use fewer imports\nFound:\n  import A\n  import A\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 29}}])]
+ tests/examples/Import15.hs view
@@ -0,0 +1,1 @@+import A hiding(Foo); import A hiding(Bar)
+ tests/examples/Import15.hs.expected view
@@ -0,0 +1,1 @@+import A hiding(Foo); import A hiding(Bar)
+ tests/examples/Import15.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import16.hs view
@@ -0,0 +1,1 @@+import List
+ tests/examples/Import16.hs.expected view
@@ -0,0 +1,1 @@+import Data.List
+ tests/examples/Import16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import16.hs:1:1: Warning: Use hierarchical imports\nFound:\n  import List\nWhy not:\n  import Data.List\n",[Replace {rtype = ModuleName, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 12}, subts = [], orig = "Data.List"}])]
+ tests/examples/Import17.hs view
@@ -0,0 +1,1 @@+import qualified List
+ tests/examples/Import17.hs.expected view
@@ -0,0 +1,1 @@+import qualified Data.List
+ tests/examples/Import17.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import17.hs:1:1: Warning: Use hierarchical imports\nFound:\n  import qualified List\nWhy not:\n  import qualified Data.List as List\n",[Replace {rtype = ModuleName, pos = SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 22}, subts = [], orig = "Data.List"}])]
+ tests/examples/Import18.hs view
@@ -0,0 +1,1 @@+import Char(foo)
+ tests/examples/Import18.hs.expected view
@@ -0,0 +1,1 @@+import Data.Char(foo)
+ tests/examples/Import18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import18.hs:1:1: Warning: Use hierarchical imports\nFound:\n  import Char (foo)\nWhy not:\n  import Data.Char (foo)\n",[Replace {rtype = ModuleName, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 12}, subts = [], orig = "Data.Char"}])]
+ tests/examples/Import19.hs view
@@ -0,0 +1,1 @@+import IO(foo)
+ tests/examples/Import19.hs.expected view
@@ -0,0 +1,1 @@+import IO(foo)
+ tests/examples/Import19.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import2.hs view
@@ -0,0 +1,1 @@+import A(Foo) ; import A
+ tests/examples/Import2.hs.expected view
@@ -0,0 +1,1 @@+ import A
+ tests/examples/Import2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import2.hs:1:1: Error: Use fewer imports\nFound:\n  import A (Foo)\n  import A\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 14}}])]
+ tests/examples/Import20.hs view
@@ -0,0 +1,1 @@+import IO as X
+ tests/examples/Import20.hs.expected view
@@ -0,0 +1,1 @@+import IO as X
+ tests/examples/Import20.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import20.hs:1:1: Warning: Use hierarchical imports\nFound:\n  import IO as X\nWhy not:\n  import System.IO as X\n  import System.IO.Error as X\n  import Control.Exception as X (bracket, bracket_)\n",[])]
+ tests/examples/Import21.hs view
@@ -0,0 +1,2 @@+module Foo(module A, baz, module B, module C) where; import A; import D; import B(map,filter); import C +   
+ tests/examples/Import21.hs.expected view
@@ -0,0 +1,2 @@+module Foo(module A, baz, module B, module C) where; import A; import D; import B(map,filter); import C+
+ tests/examples/Import21.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import21.hs:1:1: Warning: Use import/export shortcut\nFound:\n  module Foo (module A, baz, module B, module C) where\n  import A\n  import B (map, filter)\n  import C\nWhy not:\n  module Foo (baz, module X) where\n  import A as X\n  import B as X (map, filter)\n  import C as X\n",[])]
+ tests/examples/Import22.hs view
@@ -0,0 +1,2 @@+module Foo(module A, baz, module B, module X) where; import A; import B; import X +   
+ tests/examples/Import22.hs.expected view
@@ -0,0 +1,2 @@+module Foo(module A, baz, module B, module X) where; import A; import B; import X+
+ tests/examples/Import22.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import22.hs:1:1: Warning: Use import/export shortcut\nFound:\n  module Foo (module A, baz, module B, module X) where\n  import A\n  import B\n  import X\nWhy not:\n  module Foo (baz, module Y) where\n  import A as Y\n  import B as Y\n  import X as Y\n",[])]
+ tests/examples/Import3.hs view
@@ -0,0 +1,1 @@+import A(Bar(..)); import {-# SOURCE #-} A
+ tests/examples/Import3.hs.expected view
@@ -0,0 +1,1 @@+import A(Bar(..)); import {-# SOURCE #-} A
+ tests/examples/Import3.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import4.hs view
@@ -0,0 +1,1 @@+import A; import B
+ tests/examples/Import4.hs.expected view
@@ -0,0 +1,1 @@+import A; import B
+ tests/examples/Import4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import5.hs view
@@ -0,0 +1,1 @@+import A(B) ; import A(C)
+ tests/examples/Import5.hs.expected view
@@ -0,0 +1,1 @@+import A (B, C) ;
+ tests/examples/Import5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import5.hs:1:1: Error: Use fewer imports\nFound:\n  import A (B)\n  import A (C)\nWhy not:\n  import A (B, C)\n",[Replace {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 12}, subts = [], orig = "import A (B, C)"},Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 26}}])]
+ tests/examples/Import6.hs view
@@ -0,0 +1,1 @@+import A; import A hiding (C)
+ tests/examples/Import6.hs.expected view
@@ -0,0 +1,1 @@+import A;
+ tests/examples/Import6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import6.hs:1:1: Error: Use fewer imports\nFound:\n  import A\n  import A hiding (C)\nWhy not:\n  import A\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 30}}])]
+ tests/examples/Import7.hs view
@@ -0,0 +1,1 @@+import A; import A as Y
+ tests/examples/Import7.hs.expected view
@@ -0,0 +1,1 @@+ import A as Y
+ tests/examples/Import7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Import7.hs:1:1: Error: Use fewer imports\nFound:\n  import A\n  import A as Y\nWhy not:\n  import A as Y\n",[Delete {rtype = Import, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 9}}])]
+ tests/examples/Import8.hs view
@@ -0,0 +1,1 @@+import A; import qualified A as Y
+ tests/examples/Import8.hs.expected view
@@ -0,0 +1,1 @@+import A; import qualified A as Y
+ tests/examples/Import8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Import9.hs view
@@ -0,0 +1,1 @@+import A as B; import A as C
+ tests/examples/Import9.hs.expected view
@@ -0,0 +1,1 @@+import A as B; import A as C
+ tests/examples/Import9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda0.hs view
@@ -0,0 +1,1 @@+f a = \x -> x + x
+ tests/examples/Lambda0.hs.expected view
@@ -0,0 +1,1 @@+f a x = x + x
+ tests/examples/Lambda0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda0.hs:1:1: Error: Redundant lambda\nFound:\n  f a = \\ x -> x + x\nWhy not:\n  f a x = x + x\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 18}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 18}),("a",SrcSpan {startLine = 1, startCol = 3, endLine = 1, endCol = 4}),("b",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9})], orig = "f a b = body"}])]
+ tests/examples/Lambda1.hs view
@@ -0,0 +1,1 @@+f a = \a -> a + a
+ tests/examples/Lambda1.hs.expected view
@@ -0,0 +1,1 @@+f _ a = a + a
+ tests/examples/Lambda1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda1.hs:1:1: Error: Redundant lambda\nFound:\n  f a = \\ a -> a + a\nWhy not:\n  f _ a = a + a\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 18}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 18}),("a",SrcSpan {startLine = 0, startCol = 0, endLine = 0, endCol = 0}),("b",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9})], orig = "f _ b = body"}])]
+ tests/examples/Lambda10.hs view
@@ -0,0 +1,1 @@+f = foo (flip op x)
+ tests/examples/Lambda10.hs.expected view
@@ -0,0 +1,1 @@+f = foo (flip op x)
+ tests/examples/Lambda10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda10.hs:1:9: Warning: Use section\nFound:\n  (flip op x)\nWhy not:\n  (`op` x)\n",[])]
+ tests/examples/Lambda11.hs view
@@ -0,0 +1,1 @@+f = flip op x
+ tests/examples/Lambda11.hs.expected view
@@ -0,0 +1,1 @@+f = flip op x
+ tests/examples/Lambda11.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda12.hs view
@@ -0,0 +1,1 @@+f = foo (flip (*) x)
+ tests/examples/Lambda12.hs.expected view
@@ -0,0 +1,1 @@+f = foo (flip (*) x)
+ tests/examples/Lambda12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda12.hs:1:9: Warning: Use section\nFound:\n  (flip (*) x)\nWhy not:\n  (* x)\n",[])]
+ tests/examples/Lambda13.hs view
@@ -0,0 +1,1 @@+f = foo (flip (-) x)
+ tests/examples/Lambda13.hs.expected view
@@ -0,0 +1,1 @@+f = foo (flip (-) x)
+ tests/examples/Lambda13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda14.hs view
@@ -0,0 +1,1 @@+f = foo (\x y -> fun x y)
+ tests/examples/Lambda14.hs.expected view
@@ -0,0 +1,1 @@+f = foo (fun)
+ tests/examples/Lambda14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda14.hs:1:10: Error: Avoid lambda\nFound:\n  \\ x y -> fun x y\nWhy not:\n  fun\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 25}, subts = [("x",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 21})], orig = "x"}])]
+ tests/examples/Lambda15.hs view
@@ -0,0 +1,1 @@+f = foo (\x y -> x + y)
+ tests/examples/Lambda15.hs.expected view
@@ -0,0 +1,1 @@+f = foo ((+))
+ tests/examples/Lambda15.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda15.hs:1:10: Error: Avoid lambda\nFound:\n  \\ x y -> x + y\nWhy not:\n  (+)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 23}, subts = [], orig = "(+)"}])]
+ tests/examples/Lambda16.hs view
@@ -0,0 +1,1 @@+f = foo (\x -> x * y)
+ tests/examples/Lambda16.hs.expected view
@@ -0,0 +1,1 @@+f = foo ((* y))
+ tests/examples/Lambda16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda16.hs:1:10: Warning: Avoid lambda\nFound:\n  \\ x -> x * y\nWhy not:\n  (* y)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 21}, subts = [], orig = "(* y)"}])]
+ tests/examples/Lambda17.hs view
@@ -0,0 +1,1 @@+f = foo (\x -> x # y)
+ tests/examples/Lambda17.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\x -> x # y)
+ tests/examples/Lambda17.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda18.hs view
@@ -0,0 +1,1 @@+f = foo (\x -> \y -> x x y y)
+ tests/examples/Lambda18.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\ x y -> x x y y)
+ tests/examples/Lambda18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda18.hs:1:10: Warning: Collapse lambdas\nFound:\n  \\ x -> \\ y -> x x y y\nWhy not:\n  \\ x y -> x x y y\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 29}, subts = [("body",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 29}),("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 12}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18})], orig = "\\ a b -> body"}])]
+ tests/examples/Lambda19.hs view
@@ -0,0 +1,1 @@+f = foo (\x -> \x -> foo x x)
+ tests/examples/Lambda19.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\ _ x -> foo x x)
+ tests/examples/Lambda19.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda19.hs:1:10: Warning: Collapse lambdas\nFound:\n  \\ x -> \\ x -> foo x x\nWhy not:\n  \\ _ x -> foo x x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 29}, subts = [("body",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 29}),("a",SrcSpan {startLine = 0, startCol = 0, endLine = 0, endCol = 0}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18})], orig = "\\ _ b -> body"}])]
+ tests/examples/Lambda2.hs view
@@ -0,0 +1,1 @@+f a = \x -> x + x where _ = test
+ tests/examples/Lambda2.hs.expected view
@@ -0,0 +1,1 @@+f a = \x -> x + x where _ = test
+ tests/examples/Lambda2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda20.hs view
@@ -0,0 +1,1 @@+f = foo (\(x:xs) -> \x -> foo x x)
+ tests/examples/Lambda20.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\ (x:xs) x -> foo x x)
+ tests/examples/Lambda20.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda20.hs:1:10: Warning: Collapse lambdas\nFound:\n  \\ (x : xs) -> \\ x -> foo x x\nWhy not:\n  \\ (_ : xs) x -> foo x x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 34}, subts = [("body",SrcSpan {startLine = 1, startCol = 27, endLine = 1, endCol = 34}),("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 17}),("b",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "\\ a b -> body"}])]
+ tests/examples/Lambda21.hs view
@@ -0,0 +1,1 @@+f = foo (\x -> \y -> \z -> x x y y z z)
+ tests/examples/Lambda21.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\ x y z -> x x y y z z)
+ tests/examples/Lambda21.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda21.hs:1:10: Warning: Collapse lambdas\nFound:\n  \\ x -> \\ y -> \\ z -> x x y y z z\nWhy not:\n  \\ x y z -> x x y y z z\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 39}, subts = [("body",SrcSpan {startLine = 1, startCol = 28, endLine = 1, endCol = 39}),("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 12}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 18}),("c",SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 24})], orig = "\\ a b c -> body"}])]
+ tests/examples/Lambda22.hs view
@@ -0,0 +1,1 @@+x ! y = fromJust $ lookup x y
+ tests/examples/Lambda22.hs.expected view
@@ -0,0 +1,1 @@+x ! y = fromJust $ lookup x y
+ tests/examples/Lambda22.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda23.hs view
@@ -0,0 +1,1 @@+f = foo (\i -> writeIdea (getClass i) i)
+ tests/examples/Lambda23.hs.expected view
@@ -0,0 +1,1 @@+f = foo (\i -> writeIdea (getClass i) i)
+ tests/examples/Lambda23.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda24.hs view
@@ -0,0 +1,1 @@+f = bar (flip Foo.bar x)
+ tests/examples/Lambda24.hs.expected view
@@ -0,0 +1,1 @@+f = bar (flip Foo.bar x)
+ tests/examples/Lambda24.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda24.hs:1:9: Warning: Use section\nFound:\n  (flip Foo.bar x)\nWhy not:\n  (`Foo.bar` x)\n",[])]
+ tests/examples/Lambda25.hs view
@@ -0,0 +1,1 @@+f = a b (\x -> c x d) 
+ tests/examples/Lambda25.hs.expected view
@@ -0,0 +1,1 @@+f = a b ((`c` d))
+ tests/examples/Lambda25.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda25.hs:1:10: Warning: Avoid lambda\nFound:\n  \\ x -> c x d\nWhy not:\n  (`c` d)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 21}, subts = [], orig = "(`c` d)"}])]
+ tests/examples/Lambda26.hs view
@@ -0,0 +1,1 @@+yes = \x -> a x where
+ tests/examples/Lambda26.hs.expected view
@@ -0,0 +1,1 @@+yes = a where
+ tests/examples/Lambda26.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda26.hs:1:7: Error: Avoid lambda\nFound:\n  \\ x -> a x\nWhy not:\n  a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 16}, subts = [("x",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 14})], orig = "x"}])]
+ tests/examples/Lambda27.hs view
@@ -0,0 +1,1 @@+yes = \x y -> op y x where
+ tests/examples/Lambda27.hs.expected view
@@ -0,0 +1,1 @@+yes = flip op where
+ tests/examples/Lambda27.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda27.hs:1:7: Warning: Avoid lambda\nFound:\n  \\ x y -> op y x\nWhy not:\n  flip op\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 21}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 17})], orig = "flip x"}])]
+ tests/examples/Lambda28.hs view
@@ -0,0 +1,1 @@+f = \y -> nub $ reverse y where
+ tests/examples/Lambda28.hs.expected view
@@ -0,0 +1,1 @@+f = nub . reverse where
+ tests/examples/Lambda28.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda28.hs:1:5: Warning: Avoid lambda\nFound:\n  \\ y -> nub $ reverse y\nWhy not:\n  nub . reverse\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 26}, subts = [("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 14}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 24})], orig = "a . b"}])]
+ tests/examples/Lambda29.hs view
@@ -0,0 +1,1 @@+f = \z -> foo $ bar $ baz z where
+ tests/examples/Lambda29.hs.expected view
@@ -0,0 +1,1 @@+f = foo . bar . baz where
+ tests/examples/Lambda29.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda29.hs:1:5: Warning: Avoid lambda\nFound:\n  \\ z -> foo $ bar $ baz z\nWhy not:\n  foo . bar . baz\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 28}, subts = [("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 14}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 20}),("c",SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 26})], orig = "a . b . c"}])]
+ tests/examples/Lambda3.hs view
@@ -0,0 +1,1 @@+f = \x -> x + x
+ tests/examples/Lambda3.hs.expected view
@@ -0,0 +1,1 @@+f x = x + x
+ tests/examples/Lambda3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda3.hs:1:1: Error: Redundant lambda\nFound:\n  f = \\ x -> x + x\nWhy not:\n  f x = x + x\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 16}, subts = [("body",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 16}),("a",SrcSpan {startLine = 1, startCol = 6, endLine = 1, endCol = 7})], orig = "f a = body"}])]
+ tests/examples/Lambda30.hs view
@@ -0,0 +1,1 @@+f = \z -> foo $ bar x $ baz z where
+ tests/examples/Lambda30.hs.expected view
@@ -0,0 +1,1 @@+f = foo . bar x . baz where
+ tests/examples/Lambda30.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda30.hs:1:5: Warning: Avoid lambda\nFound:\n  \\ z -> foo $ bar x $ baz z\nWhy not:\n  foo . bar x . baz\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 30}, subts = [("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 14}),("b",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 22}),("c",SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 28})], orig = "a . b . c"}])]
+ tests/examples/Lambda31.hs view
@@ -0,0 +1,1 @@+f = \z -> foo $ z $ baz z where
+ tests/examples/Lambda31.hs.expected view
@@ -0,0 +1,1 @@+f = \z -> foo $ z $ baz z where
+ tests/examples/Lambda31.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda32.hs view
@@ -0,0 +1,1 @@+f = \x -> bar map (filter x) where
+ tests/examples/Lambda32.hs.expected view
@@ -0,0 +1,1 @@+f = bar map . filter where
+ tests/examples/Lambda32.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda32.hs:1:5: Warning: Avoid lambda\nFound:\n  \\ x -> bar map (filter x)\nWhy not:\n  bar map . filter\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 29}, subts = [("a",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 18}),("b",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 26})], orig = "a . b"}])]
+ tests/examples/Lambda33.hs view
@@ -0,0 +1,1 @@+f = bar &+& \x -> f (g x)
+ tests/examples/Lambda33.hs.expected view
@@ -0,0 +1,1 @@+f = bar &+& \x -> f (g x)
+ tests/examples/Lambda33.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda34.hs view
@@ -0,0 +1,1 @@+foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]]
+ tests/examples/Lambda34.hs.expected view
@@ -0,0 +1,1 @@+foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]]
+ tests/examples/Lambda34.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda35.hs view
@@ -0,0 +1,1 @@+foo = [\x -> x]
+ tests/examples/Lambda35.hs.expected view
@@ -0,0 +1,1 @@+foo = [id]
+ tests/examples/Lambda35.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda35.hs:1:8: Error: Use id\nFound:\n  \\ x -> x\nWhy not:\n  id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 15}, subts = [], orig = "id"}])]
+ tests/examples/Lambda36.hs view
@@ -0,0 +1,1 @@+foo = [\m x -> insert x x m]
+ tests/examples/Lambda36.hs.expected view
@@ -0,0 +1,1 @@+foo = [\m x -> insert x x m]
+ tests/examples/Lambda36.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda37.hs view
@@ -0,0 +1,1 @@+foo a b c = bar (flux ++ quux) c where flux = a
+ tests/examples/Lambda37.hs.expected view
@@ -0,0 +1,1 @@+foo a b = bar (flux ++ quux)
+ tests/examples/Lambda37.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda37.hs:1:1: Error: Eta reduce\nFound:\n  foo a b c = bar (flux ++ quux) c\nWhy not:\n  foo a b = bar (flux ++ quux)\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 48}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 31}),("a",SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 6}),("b",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8})], orig = "foo a b = body"}])]
+ tests/examples/Lambda38.hs view
@@ -0,0 +1,1 @@+foo a b c = bar (flux ++ quux) c where flux = c
+ tests/examples/Lambda38.hs.expected view
@@ -0,0 +1,1 @@+foo a b c = bar (flux ++ quux) c where flux = c
+ tests/examples/Lambda38.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda39.hs view
@@ -0,0 +1,1 @@+yes = foo (\x -> Just x)
+ tests/examples/Lambda39.hs.expected view
@@ -0,0 +1,1 @@+yes = foo (Just)
+ tests/examples/Lambda39.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda39.hs:1:12: Error: Avoid lambda\nFound:\n  \\ x -> Just x\nWhy not:\n  Just\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 24}, subts = [("x",SrcSpan {startLine = 1, startCol = 18, endLine = 1, endCol = 22})], orig = "x"}])]
+ tests/examples/Lambda4.hs view
@@ -0,0 +1,1 @@+fun x y z = f x y z
+ tests/examples/Lambda4.hs.expected view
@@ -0,0 +1,1 @@+fun = f
+ tests/examples/Lambda4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda4.hs:1:1: Error: Eta reduce\nFound:\n  fun x y z = f x y z\nWhy not:\n  fun = f\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 20}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 14})], orig = "fun = body"}])]
+ tests/examples/Lambda40.hs view
@@ -0,0 +1,1 @@+foo = bar (\x -> (x `f`))
+ tests/examples/Lambda40.hs.expected view
@@ -0,0 +1,1 @@+foo = bar (f)
+ tests/examples/Lambda40.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda40.hs:1:12: Error: Avoid lambda\nFound:\n  \\ x -> (x `f`)\nWhy not:\n  f\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 25}, subts = [], orig = "f"}])]
+ tests/examples/Lambda41.hs view
@@ -0,0 +1,1 @@+baz = bar (\x -> (x +))
+ tests/examples/Lambda41.hs.expected view
@@ -0,0 +1,1 @@+baz = bar ((+))
+ tests/examples/Lambda41.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda41.hs:1:12: Error: Avoid lambda\nFound:\n  \\ x -> (x +)\nWhy not:\n  (+)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 23}, subts = [], orig = "(+)"}])]
+ tests/examples/Lambda5.hs view
@@ -0,0 +1,1 @@+fun x y z = f x x y z
+ tests/examples/Lambda5.hs.expected view
@@ -0,0 +1,1 @@+fun x = f x x
+ tests/examples/Lambda5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda5.hs:1:1: Error: Eta reduce\nFound:\n  fun x y z = f x x y z\nWhy not:\n  fun x = f x x\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 22}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 18}),("a",SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 6})], orig = "fun a = body"}])]
+ tests/examples/Lambda6.hs view
@@ -0,0 +1,1 @@+fun x y z = f g z
+ tests/examples/Lambda6.hs.expected view
@@ -0,0 +1,1 @@+fun x y = f g
+ tests/examples/Lambda6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda6.hs:1:1: Error: Eta reduce\nFound:\n  fun x y z = f g z\nWhy not:\n  fun x y = f g\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 18}, subts = [("body",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 16}),("a",SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 6}),("b",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8})], orig = "fun a b = body"}])]
+ tests/examples/Lambda7.hs view
@@ -0,0 +1,1 @@+fun mr = y mr
+ tests/examples/Lambda7.hs.expected view
@@ -0,0 +1,1 @@+fun mr = y mr
+ tests/examples/Lambda7.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Lambda8.hs view
@@ -0,0 +1,1 @@+f = foo ((*) x)
+ tests/examples/Lambda8.hs.expected view
@@ -0,0 +1,1 @@+f = foo ((*) x)
+ tests/examples/Lambda8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Lambda8.hs:1:9: Warning: Use section\nFound:\n  ((*) x)\nWhy not:\n  (x *)\n",[])]
+ tests/examples/Lambda9.hs view
@@ -0,0 +1,1 @@+f = (*) x
+ tests/examples/Lambda9.hs.expected view
@@ -0,0 +1,1 @@+f = (*) x
+ tests/examples/Lambda9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/List0.hs view
@@ -0,0 +1,1 @@+yes = 1:2:[]
+ tests/examples/List0.hs.expected view
@@ -0,0 +1,1 @@+yes = [1, 2]
+ tests/examples/List0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List0.hs:1:7: Warning: Use list literal\nFound:\n  1 : 2 : []\nWhy not:\n  [1, 2]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 13}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8}),("b",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 10})], orig = "[a, b]"}])]
+ tests/examples/List1.hs view
@@ -0,0 +1,1 @@+yes = ['h','e','l','l','o']
+ tests/examples/List1.hs.expected view
@@ -0,0 +1,1 @@+yes = "hello"
+ tests/examples/List1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List1.hs:1:7: Warning: Use string literal\nFound:\n  ['h', 'e', 'l', 'l', 'o']\nWhy not:\n  \"hello\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 28}, subts = [], orig = "\"hello\""}])]
+ tests/examples/List10.hs view
@@ -0,0 +1,1 @@+yes = if x == e then l2 ++ xs else [x] ++ check_elem xs
+ tests/examples/List10.hs.expected view
@@ -0,0 +1,1 @@+yes = if x == e then l2 ++ xs else x : check_elem xs
+ tests/examples/List10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List10.hs:1:36: Warning: Use :\nFound:\n  [x] ++ check_elem xs\nWhy not:\n  x : check_elem xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 36, endLine = 1, endCol = 56}, subts = [("x",SrcSpan {startLine = 1, startCol = 37, endLine = 1, endCol = 38}),("xs",SrcSpan {startLine = 1, startCol = 43, endLine = 1, endCol = 56})], orig = "x : xs"}])]
+ tests/examples/List11.hs view
@@ -0,0 +1,1 @@+data Yes = Yes (Maybe [Char])
+ tests/examples/List11.hs.expected view
@@ -0,0 +1,1 @@+data Yes = Yes (Maybe String)
+ tests/examples/List11.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List11.hs:1:17: Warning: Use String\nFound:\n  Maybe [Char]\nWhy not:\n  Maybe String\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 29}, subts = [], orig = "String"}])]
+ tests/examples/List12.hs view
@@ -0,0 +1,1 @@+yes = y :: [Char] -> a
+ tests/examples/List12.hs.expected view
@@ -0,0 +1,1 @@+yes = y :: String -> a
+ tests/examples/List12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List12.hs:1:12: Warning: Use String\nFound:\n  [Char] -> a\nWhy not:\n  String -> a\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 18}, subts = [], orig = "String"}])]
+ tests/examples/List13.hs view
@@ -0,0 +1,1 @@+instance C [Char]
+ tests/examples/List13.hs.expected view
@@ -0,0 +1,1 @@+instance C [Char]
+ tests/examples/List13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/List14.hs view
@@ -0,0 +1,1 @@+foo = [a b] ++ xs
+ tests/examples/List14.hs.expected view
@@ -0,0 +1,1 @@+foo = a b : xs
+ tests/examples/List14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List14.hs:1:7: Warning: Use :\nFound:\n  [a b] ++ xs\nWhy not:\n  a b : xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 18}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 11}),("xs",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 18})], orig = "x : xs"}])]
+ tests/examples/List2.hs view
@@ -0,0 +1,1 @@+yes (1:2:[]) = 1
+ tests/examples/List2.hs.expected view
@@ -0,0 +1,1 @@+yes [1, 2] = 1
+ tests/examples/List2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List2.hs:1:5: Warning: Use list literal pattern\nFound:\n  (1 : (2 : []))\nWhy not:\n  [1, 2]\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 13}, subts = [("a",SrcSpan {startLine = 1, startCol = 6, endLine = 1, endCol = 7}),("b",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9})], orig = "[a, b]"}])]
+ tests/examples/List3.hs view
@@ -0,0 +1,1 @@+yes ['h','e'] = 1
+ tests/examples/List3.hs.expected view
@@ -0,0 +1,1 @@+yes "he" = 1
+ tests/examples/List3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List3.hs:1:5: Warning: Use string literal pattern\nFound:\n  ['h', 'e']\nWhy not:\n  \"he\"\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 14}, subts = [], orig = "\"he\""}])]
+ tests/examples/List4.hs view
@@ -0,0 +1,1 @@+yes = [x] ++ xs
+ tests/examples/List4.hs.expected view
@@ -0,0 +1,1 @@+yes = x : xs
+ tests/examples/List4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List4.hs:1:7: Warning: Use :\nFound:\n  [x] ++ xs\nWhy not:\n  x : xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 16}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 9}),("xs",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 16})], orig = "x : xs"}])]
+ tests/examples/List5.hs view
@@ -0,0 +1,1 @@+no = "x" ++ xs
+ tests/examples/List5.hs.expected view
@@ -0,0 +1,1 @@+no = "x" ++ xs
+ tests/examples/List5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/List6.hs view
@@ -0,0 +1,1 @@+no = [x] ++ xs ++ ys
+ tests/examples/List6.hs.expected view
@@ -0,0 +1,1 @@+no = [x] ++ xs ++ ys
+ tests/examples/List6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/List7.hs view
@@ -0,0 +1,1 @@+no = xs ++ [x] ++ ys
+ tests/examples/List7.hs.expected view
@@ -0,0 +1,1 @@+no = xs ++ [x] ++ ys
+ tests/examples/List7.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/List8.hs view
@@ -0,0 +1,1 @@+yes = [if a then b else c] ++ xs
+ tests/examples/List8.hs.expected view
@@ -0,0 +1,1 @@+yes = if a then b else c : xs
+ tests/examples/List8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List8.hs:1:7: Warning: Use :\nFound:\n  [if a then b else c] ++ xs\nWhy not:\n  (if a then b else c) : xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 33}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 26}),("xs",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 33})], orig = "x : xs"}])]
+ tests/examples/List9.hs view
@@ -0,0 +1,1 @@+yes = [1] : [2] : [3] : [4] : [5] : []
+ tests/examples/List9.hs.expected view
@@ -0,0 +1,1 @@+yes = [[1], [2], [3], [4], [5]]
+ tests/examples/List9.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/List9.hs:1:7: Warning: Use list literal\nFound:\n  [1] : [2] : [3] : [4] : [5] : []\nWhy not:\n  [[1], [2], [3], [4], [5]]\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 39}, subts = [("a",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 10}),("b",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 16}),("c",SrcSpan {startLine = 1, startCol = 19, endLine = 1, endCol = 22}),("d",SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 28}),("e",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 34})], orig = "[a, b, c, d, e]"}])]
+ tests/examples/ListRec0.hs view
@@ -0,0 +1,1 @@+f (x:xs) = negate x + f xs ; f [] = 0
+ tests/examples/ListRec0.hs.expected view
@@ -0,0 +1,1 @@+f xs = foldr ((+) . negate) 0 xs
+ tests/examples/ListRec0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec0.hs:1:1: Warning: Use foldr\nFound:\n  f (x : xs) = negate x + f xs\n  f [] = 0\nWhy not:\n  f xs = foldr ((+) . negate) 0 xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 38}, subts = [], orig = "f xs = foldr ((+) . negate) 0 xs"}])]
+ tests/examples/ListRec1.hs view
@@ -0,0 +1,1 @@+f (x:xs) = x + 1 : f xs ; f [] = []
+ tests/examples/ListRec1.hs.expected view
@@ -0,0 +1,1 @@+f xs = map (+ 1) xs
+ tests/examples/ListRec1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec1.hs:1:1: Error: Use map\nFound:\n  f (x : xs) = x + 1 : f xs\n  f [] = []\nWhy not:\n  f xs = map (+ 1) xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 36}, subts = [], orig = "f xs = map (+ 1) xs"}])]
+ tests/examples/ListRec2.hs view
@@ -0,0 +1,1 @@+f z (x:xs) = f (z*x) xs ; f z [] = z
+ tests/examples/ListRec2.hs.expected view
@@ -0,0 +1,1 @@+f z xs = foldl (*) z xs
+ tests/examples/ListRec2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec2.hs:1:1: Warning: Use foldl\nFound:\n  f z (x : xs) = f (z * x) xs\n  f z [] = z\nWhy not:\n  f z xs = foldl (*) z xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 37}, subts = [], orig = "f z xs = foldl (*) z xs"}])]
+ tests/examples/ListRec3.hs view
@@ -0,0 +1,1 @@+f a (x:xs) b = x + a + b : f a xs b ; f a [] b = []
+ tests/examples/ListRec3.hs.expected view
@@ -0,0 +1,1 @@+f a xs b = map (\ x -> x + a + b) xs
+ tests/examples/ListRec3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec3.hs:1:1: Error: Use map\nFound:\n  f a (x : xs) b = x + a + b : f a xs b\n  f a [] b = []\nWhy not:\n  f a xs b = map (\\ x -> x + a + b) xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 52}, subts = [], orig = "f a xs b = map (\\ x -> x + a + b) xs"}])]
+ tests/examples/ListRec4.hs view
@@ -0,0 +1,1 @@+f [] a = return a ; f (x:xs) a = a + x >>= \fax -> f xs fax
+ tests/examples/ListRec4.hs.expected view
@@ -0,0 +1,1 @@+f xs a = foldM (+) a xs
+ tests/examples/ListRec4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec4.hs:1:1: Warning: Use foldM\nFound:\n  f [] a = return a\n  f (x : xs) a = a + x >>= \\ fax -> f xs fax\nWhy not:\n  f xs a = foldM (+) a xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 60}, subts = [], orig = "f xs a = foldM (+) a xs"}])]
+ tests/examples/ListRec5.hs view
@@ -0,0 +1,1 @@+foos [] x = x; foos (y:ys) x = foo y $ foos ys x
+ tests/examples/ListRec5.hs.expected view
@@ -0,0 +1,1 @@+foos ys x = foldr foo x ys
+ tests/examples/ListRec5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec5.hs:1:1: Warning: Use foldr\nFound:\n  foos [] x = x\n  foos (y : ys) x = foo y $ foos ys x\nWhy not:\n  foos ys x = foldr foo x ys\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 49}, subts = [], orig = "foos ys x = foldr foo x ys"}])]
+ tests/examples/ListRec6.hs view
@@ -0,0 +1,1 @@+f [] y = y; f (x:xs) y = f xs $ g x y
+ tests/examples/ListRec6.hs.expected view
@@ -0,0 +1,1 @@+f xs y = foldl (flip g) y xs
+ tests/examples/ListRec6.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec6.hs:1:1: Warning: Use foldl\nFound:\n  f [] y = y\n  f (x : xs) y = f xs $ g x y\nWhy not:\n  f xs y = foldl (flip g) y xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 38}, subts = [], orig = "f xs y = foldl (flip g) y xs"}])]
+ tests/examples/ListRec7.hs view
@@ -0,0 +1,1 @@+f [] y = y; f (x : xs) y = let z = g x y in f xs z
+ tests/examples/ListRec7.hs.expected view
@@ -0,0 +1,1 @@+f xs y = foldl (flip g) y xs
+ tests/examples/ListRec7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/ListRec7.hs:1:1: Warning: Use foldl\nFound:\n  f [] y = y\n  f (x : xs) y = let z = g x y in f xs z\nWhy not:\n  f xs y = foldl (flip g) y xs\n",[Replace {rtype = Decl, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 51}, subts = [], orig = "f xs y = foldl (flip g) y xs"}])]
+ tests/examples/ListRec8.hs view
@@ -0,0 +1,1 @@+f [] y = y; f (x:xs) y = f xs (f xs z)
+ tests/examples/ListRec8.hs.expected view
@@ -0,0 +1,1 @@+f [] y = y; f (x:xs) y = f xs (f xs z)
+ tests/examples/ListRec8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad0.hs view
@@ -0,0 +1,1 @@+yes = do mapM print a; return b
+ tests/examples/Monad0.hs.expected view
@@ -0,0 +1,1 @@+yes = do mapM_ print a; return b
+ tests/examples/Monad0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad0.hs:1:10: Error: Use mapM_\nFound:\n  mapM print a\nWhy not:\n  mapM_ print a\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 14}, subts = [], orig = "mapM_"}])]
+ tests/examples/Monad1.hs view
@@ -0,0 +1,1 @@+no = mapM print a
+ tests/examples/Monad1.hs.expected view
@@ -0,0 +1,1 @@+no = mapM print a
+ tests/examples/Monad1.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad10.hs view
@@ -0,0 +1,1 @@+yes = do x <- return y; foo x
+ tests/examples/Monad10.hs.expected view
@@ -0,0 +1,1 @@+yes = do let x = y; foo x
+ tests/examples/Monad10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad10.hs:1:7: Warning: Use let\nFound:\n  do x <- return y\n     foo x\nWhy not:\n  do let x = y\n     foo x\n",[Replace {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 23}, subts = [("lhs",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11}),("rhs",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "let lhs = rhs"}])]
+ tests/examples/Monad11.hs view
@@ -0,0 +1,1 @@+yes = do x <- return $ y + z; foo x
+ tests/examples/Monad11.hs.expected view
@@ -0,0 +1,1 @@+yes = do let x = y + z; foo x
+ tests/examples/Monad11.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad11.hs:1:7: Warning: Use let\nFound:\n  do x <- return $ y + z\n     foo x\nWhy not:\n  do let x = y + z\n     foo x\n",[Replace {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 29}, subts = [("lhs",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 11}),("rhs",SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 29})], orig = "let lhs = rhs"}])]
+ tests/examples/Monad12.hs view
@@ -0,0 +1,1 @@+no = do x <- return x; foo x
+ tests/examples/Monad12.hs.expected view
@@ -0,0 +1,1 @@+no = do x <- return x; foo x
+ tests/examples/Monad12.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad13.hs view
@@ -0,0 +1,1 @@+no = do x <- return y; x <- return y; foo x
+ tests/examples/Monad13.hs.expected view
@@ -0,0 +1,1 @@+no = do x <- return y; x <- return y; foo x
+ tests/examples/Monad13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad14.hs view
@@ -0,0 +1,1 @@+yes = do forM files $ \x -> return (); return ()
+ tests/examples/Monad14.hs.expected view
@@ -0,0 +1,1 @@+yes = do forM_ files $ \x -> return (); return ()
+ tests/examples/Monad14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad14.hs:1:10: Error: Use forM_\nFound:\n  forM files $ \\ x -> return ()\nWhy not:\n  forM_ files $ \\ x -> return ()\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 14}, subts = [], orig = "forM_"}])]
+ tests/examples/Monad15.hs view
@@ -0,0 +1,1 @@+yes = do if a then forM x y else sequence z q; return ()
+ tests/examples/Monad15.hs.expected view
@@ -0,0 +1,1 @@+yes = do if a then forM_ x y else sequence_ z q; return ()
+ tests/examples/Monad15.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad15.hs:1:10: Error: Use Use simple functions\nFound:\n  if a then forM x y else sequence z q\nWhy not:\n  if a then forM_ x y else sequence_ z q\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 24}, subts = [], orig = "forM_"},Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 34, endLine = 1, endCol = 42}, subts = [], orig = "sequence_"}])]
+ tests/examples/Monad16.hs view
@@ -0,0 +1,1 @@+yes = do case a of {_ -> forM x y; x:xs -> forM x xs}; return ()
+ tests/examples/Monad16.hs.expected view
@@ -0,0 +1,1 @@+yes = do case a of {_ -> forM_ x y; x:xs -> forM_ x xs}; return ()
+ tests/examples/Monad16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad16.hs:1:10: Error: Use Use simple functions\nFound:\n  case a of\n      _ -> forM x y\n      x : xs -> forM x xs\nWhy not:\n  case a of\n      _ -> forM_ x y\n      x : xs -> forM_ x xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 26, endLine = 1, endCol = 30}, subts = [], orig = "forM_"},Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 44, endLine = 1, endCol = 48}, subts = [], orig = "forM_"}])]
+ tests/examples/Monad17.hs view
@@ -0,0 +1,1 @@+foldM_ f a xs = foldM f a xs >> return ()
+ tests/examples/Monad17.hs.expected view
@@ -0,0 +1,1 @@+foldM_ f a xs = Control.Monad.void (foldM f a xs)
+ tests/examples/Monad17.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad17.hs:1:17: Warning: Use void\nFound:\n  foldM f a xs >> return ()\nWhy not:\n  Control.Monad.void (foldM f a xs)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 42}, subts = [("a",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 29})], orig = "Control.Monad.void (a)"}])]
+ tests/examples/Monad18.hs view
@@ -0,0 +1,1 @@+folder f a xs = foldM f a xs >> return ()
+ tests/examples/Monad18.hs.expected view
@@ -0,0 +1,1 @@+folder f a xs = Control.Monad.void (foldM f a xs)
+ tests/examples/Monad18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad18.hs:1:17: Error: Use foldM_\nFound:\n  foldM f a xs\nWhy not:\n  foldM_ f a xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 22}, subts = [], orig = "foldM_"}]),("tests/examples/Monad18.hs:1:17: Warning: Use void\nFound:\n  foldM f a xs >> return ()\nWhy not:\n  Control.Monad.void (foldM f a xs)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 42}, subts = [("a",SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 29})], orig = "Control.Monad.void (a)"}])]
+ tests/examples/Monad19.hs view
@@ -0,0 +1,1 @@+yes = mapM async ds >>= mapM wait >> return ()
+ tests/examples/Monad19.hs.expected view
@@ -0,0 +1,1 @@+yes = mapM async ds >>= mapM_ wait >> return ()
+ tests/examples/Monad19.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad19.hs:1:7: Error: Use mapM_\nFound:\n  mapM async ds >>= mapM wait\nWhy not:\n  mapM async ds >>= mapM_ wait\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 29}, subts = [], orig = "mapM_"}])]
+ tests/examples/Monad2.hs view
@@ -0,0 +1,1 @@+no = do foo ; mapM print a
+ tests/examples/Monad2.hs.expected view
@@ -0,0 +1,1 @@+no = do foo ; mapM print a
+ tests/examples/Monad2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad3.hs view
@@ -0,0 +1,1 @@+yes = do (bar+foo)
+ tests/examples/Monad3.hs.expected view
@@ -0,0 +1,1 @@+yes = (bar+foo)
+ tests/examples/Monad3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad3.hs:1:7: Error: Redundant do\nFound:\n  do (bar + foo)\nWhy not:\n  (bar + foo)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 19}, subts = [("y",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 19})], orig = "y"}]),("tests/examples/Monad3.hs:1:7: Warning: Redundant bracket\nFound:\n  do (bar + foo)\nWhy not:\n  do bar + foo\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 19}, subts = [("x",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 18})], orig = "x"}])]
+ tests/examples/Monad4.hs view
@@ -0,0 +1,1 @@+no = do bar ; foo
+ tests/examples/Monad4.hs.expected view
@@ -0,0 +1,1 @@+no = do bar ; foo
+ tests/examples/Monad4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad5.hs view
@@ -0,0 +1,1 @@+yes = do bar; a <- foo; return a
+ tests/examples/Monad5.hs.expected view
@@ -0,0 +1,1 @@+yes = do bar; foo;
+ tests/examples/Monad5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad5.hs:1:7: Error: Redundant return\nFound:\n  do bar\n     a <- foo\n     return a\nWhy not:\n  do bar\n     foo\n",[Replace {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 23})], orig = "x"},Delete {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 25, endLine = 1, endCol = 33}}])]
+ tests/examples/Monad6.hs view
@@ -0,0 +1,1 @@+no = do bar; a <- foo; return b
+ tests/examples/Monad6.hs.expected view
@@ -0,0 +1,1 @@+no = do bar; a <- foo; return b
+ tests/examples/Monad6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad7.hs view
@@ -0,0 +1,1 @@+yes = do x <- bar; x
+ tests/examples/Monad7.hs.expected view
@@ -0,0 +1,1 @@+yes = do join bar;
+ tests/examples/Monad7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Monad7.hs:1:7: Error: Use join\nFound:\n  do x <- bar\n     x\nWhy not:\n  do join bar\n",[Replace {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 18}, subts = [("x",SrcSpan {startLine = 1, startCol = 15, endLine = 1, endCol = 18})], orig = "join x"},Delete {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 20, endLine = 1, endCol = 21}}])]
+ tests/examples/Monad8.hs view
@@ -0,0 +1,1 @@+no = do x <- bar; x; x
+ tests/examples/Monad8.hs.expected view
@@ -0,0 +1,1 @@+no = do x <- bar; x; x
+ tests/examples/Monad8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Monad9.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-}+no = mdo hook <- mkTrigger pat (act >> rmHook hook) ; return hook
+ tests/examples/Monad9.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE RecursiveDo #-}+no = mdo hook <- mkTrigger pat (act >> rmHook hook) ; return hook
+ tests/examples/Monad9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming0.hs view
@@ -0,0 +1,1 @@+data Yes = Foo | Bar'Test
+ tests/examples/Naming0.hs.expected view
@@ -0,0 +1,1 @@+data Yes = Foo | Bar'Test
+ tests/examples/Naming0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming0.hs:1:1: Warning: Use camelCase\nFound:\n  data Yes = Foo\n           | Bar'Test\nWhy not:\n  data Yes = Foo\n           | BarTest\n",[])]
+ tests/examples/Naming1.hs view
@@ -0,0 +1,1 @@+data Yes = Bar | Test_Bar
+ tests/examples/Naming1.hs.expected view
@@ -0,0 +1,1 @@+data Yes = Bar | Test_Bar
+ tests/examples/Naming1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming1.hs:1:1: Warning: Use camelCase\nFound:\n  data Yes = Bar\n           | Test_Bar\nWhy not:\n  data Yes = Bar\n           | TestBar\n",[])]
+ tests/examples/Naming10.hs view
@@ -0,0 +1,1 @@+data Yes = FOO_A | Foo_B
+ tests/examples/Naming10.hs.expected view
@@ -0,0 +1,1 @@+data Yes = FOO_A | Foo_B
+ tests/examples/Naming10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming10.hs:1:1: Warning: Use camelCase\nFound:\n  data Yes = FOO_A\n           | Foo_B\nWhy not:\n  data Yes = FOO_A\n           | FooB\n",[])]
+ tests/examples/Naming11.hs view
@@ -0,0 +1,1 @@+case_foo = 1
+ tests/examples/Naming11.hs.expected view
@@ -0,0 +1,1 @@+case_foo = 1
+ tests/examples/Naming11.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming12.hs view
@@ -0,0 +1,1 @@+cast_foo = 1
+ tests/examples/Naming12.hs.expected view
@@ -0,0 +1,1 @@+cast_foo = 1
+ tests/examples/Naming12.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming12.hs:1:1: Warning: Use camelCase\nFound:\n  cast_foo = ...\nWhy not:\n  castFoo = ...\n",[])]
+ tests/examples/Naming13.hs view
@@ -0,0 +1,1 @@+replicateM_ = 1
+ tests/examples/Naming13.hs.expected view
@@ -0,0 +1,1 @@+replicateM_ = 1
+ tests/examples/Naming13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming14.hs view
@@ -0,0 +1,1 @@+_foo__ = 1
+ tests/examples/Naming14.hs.expected view
@@ -0,0 +1,1 @@+_foo__ = 1
+ tests/examples/Naming14.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming15.hs view
@@ -0,0 +1,1 @@+section_1_1 = 1
+ tests/examples/Naming15.hs.expected view
@@ -0,0 +1,1 @@+section_1_1 = 1
+ tests/examples/Naming15.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming16.hs view
@@ -0,0 +1,3 @@+{-# LANGUAGE MagicHash #-}++runMutator# = 1
+ tests/examples/Naming16.hs.expected view
@@ -0,0 +1,3 @@+{-# LANGUAGE MagicHash #-}++runMutator# = 1
+ tests/examples/Naming16.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming2.hs view
@@ -0,0 +1,1 @@+data No = a :::: b
+ tests/examples/Naming2.hs.expected view
@@ -0,0 +1,1 @@+data No = a :::: b
+ tests/examples/Naming2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming3.hs view
@@ -0,0 +1,1 @@+data Yes = Foo {bar_cap :: Int}
+ tests/examples/Naming3.hs.expected view
@@ -0,0 +1,1 @@+data Yes = Foo {bar_cap :: Int}
+ tests/examples/Naming3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming3.hs:1:1: Warning: Use camelCase\nFound:\n  data Yes = Foo{bar_cap :: Int}\nWhy not:\n  data Yes = Foo{barCap :: Int}\n",[])]
+ tests/examples/Naming4.hs view
@@ -0,0 +1,1 @@+data No = FOO | BarBAR | BarBBar
+ tests/examples/Naming4.hs.expected view
@@ -0,0 +1,1 @@+data No = FOO | BarBAR | BarBBar
+ tests/examples/Naming4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming5.hs view
@@ -0,0 +1,1 @@+yes_foo = yes_foo + yes_foo
+ tests/examples/Naming5.hs.expected view
@@ -0,0 +1,1 @@+yes_foo = yes_foo + yes_foo
+ tests/examples/Naming5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming5.hs:1:1: Warning: Use camelCase\nFound:\n  yes_foo = ...\nWhy not:\n  yesFoo = ...\n",[])]
+ tests/examples/Naming6.hs view
@@ -0,0 +1,1 @@+no = 1 where yes_foo = 2
+ tests/examples/Naming6.hs.expected view
@@ -0,0 +1,1 @@+no = 1 where yes_foo = 2
+ tests/examples/Naming6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming7.hs view
@@ -0,0 +1,1 @@+a -== b = 1
+ tests/examples/Naming7.hs.expected view
@@ -0,0 +1,1 @@+a -== b = 1
+ tests/examples/Naming7.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming8.hs view
@@ -0,0 +1,1 @@+myTest = 1; my_test = 1
+ tests/examples/Naming8.hs.expected view
@@ -0,0 +1,1 @@+myTest = 1; my_test = 1
+ tests/examples/Naming8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Naming9.hs view
@@ -0,0 +1,1 @@+semiring'laws = 1
+ tests/examples/Naming9.hs.expected view
@@ -0,0 +1,1 @@+semiring'laws = 1
+ tests/examples/Naming9.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Naming9.hs:1:1: Warning: Use camelCase\nFound:\n  semiring'laws = ...\nWhy not:\n  semiringLaws = ...\n",[])]
+ tests/examples/NegLit.hs view
@@ -0,0 +1,1 @@+a = -b/c
+ tests/examples/NegLit.hs.expected view
@@ -0,0 +1,1 @@+a = -b/c
+ tests/examples/NegLit.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Pragma0.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -cpp #-}
+ tests/examples/Pragma0.hs.expected view
@@ -0,0 +1,1 @@+{-# LANGUAGE CPP #-}
+ tests/examples/Pragma0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma0.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS_GHC -cpp  #-}\nWhy not:\n  {-# LANGUAGE CPP #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 25}, newComment = "{-# LANGUAGE CPP #-}"}])]
+ tests/examples/Pragma1.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS     -cpp #-}
+ tests/examples/Pragma1.hs.expected view
@@ -0,0 +1,1 @@+{-# LANGUAGE CPP #-}
+ tests/examples/Pragma1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma1.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS     -cpp  #-}\nWhy not:\n  {-# LANGUAGE CPP #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 25}, newComment = "{-# LANGUAGE CPP #-}"}])]
+ tests/examples/Pragma10.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE GADTs, DataKinds #-}
+ tests/examples/Pragma10.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE DataKinds, GADTs #-}+
+ tests/examples/Pragma10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma10.hs:1:1: Error: Use better pragmas\nFound:\n  {-# LANGUAGE DataKinds #-}\n  {-# LANGUAGE GADTs, DataKinds #-}\nWhy not:\n  {-# LANGUAGE DataKinds, GADTs #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 27}, newComment = "{-# LANGUAGE DataKinds, GADTs #-}"},ModifyComment {pos = SrcSpan {startLine = 2, startCol = 1, endLine = 2, endCol = 34}, newComment = ""}])]
+ tests/examples/Pragma2.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_YHC -cpp #-}
+ tests/examples/Pragma2.hs.expected view
@@ -0,0 +1,1 @@+{-# OPTIONS_YHC -cpp #-}
+ tests/examples/Pragma2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Pragma3.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -XFoo #-}
+ tests/examples/Pragma3.hs.expected view
@@ -0,0 +1,1 @@+{-# LANGUAGE Foo #-}
+ tests/examples/Pragma3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma3.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS_GHC -XFoo  #-}\nWhy not:\n  {-# LANGUAGE Foo #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 26}, newComment = "{-# LANGUAGE Foo #-}"}])]
+ tests/examples/Pragma4.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -fglasgow-exts #-}
+ tests/examples/Pragma4.hs.expected view
@@ -0,0 +1,30 @@+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE UnliftedFFITypes #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE ImplicitParams #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE UnboxedTuples #-}+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE ConstrainedClassMethods #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE MagicHash #-}+{-# LANGUAGE PolymorphicComponents #-}+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE UnicodeSyntax #-}+{-# LANGUAGE PostfixOperators #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE LiberalTypeSynonyms #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ImpredicativeTypes #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE RecursiveDo #-}+{-# LANGUAGE ParallelListComp #-}+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeFamilies #-}
+ tests/examples/Pragma4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma4.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS_GHC -fglasgow-exts  #-}\nWhy not:\n  {-# LANGUAGE ForeignFunctionInterface, UnliftedFFITypes, GADTs,\n    ImplicitParams, ScopedTypeVariables, UnboxedTuples,\n    TypeSynonymInstances, StandaloneDeriving, DeriveDataTypeable,\n    FlexibleContexts, FlexibleInstances, ConstrainedClassMethods,\n    MultiParamTypeClasses, FunctionalDependencies, MagicHash,\n    PolymorphicComponents, ExistentialQuantification, UnicodeSyntax,\n    PostfixOperators, PatternGuards, LiberalTypeSynonyms, RankNTypes,\n    ImpredicativeTypes, TypeOperators, RecursiveDo, ParallelListComp,\n    EmptyDataDecls, KindSignatures, GeneralizedNewtypeDeriving,\n    TypeFamilies #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 35}, newComment = "{-# LANGUAGE ForeignFunctionInterface #-}\n{-# LANGUAGE UnliftedFFITypes #-}\n{-# LANGUAGE GADTs #-}\n{-# LANGUAGE ImplicitParams #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE UnboxedTuples #-}\n{-# LANGUAGE TypeSynonymInstances #-}\n{-# LANGUAGE StandaloneDeriving #-}\n{-# LANGUAGE DeriveDataTypeable #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE ConstrainedClassMethods #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE FunctionalDependencies #-}\n{-# LANGUAGE MagicHash #-}\n{-# LANGUAGE PolymorphicComponents #-}\n{-# LANGUAGE ExistentialQuantification #-}\n{-# LANGUAGE UnicodeSyntax #-}\n{-# LANGUAGE PostfixOperators #-}\n{-# LANGUAGE PatternGuards #-}\n{-# LANGUAGE LiberalTypeSynonyms #-}\n{-# LANGUAGE RankNTypes #-}\n{-# LANGUAGE ImpredicativeTypes #-}\n{-# LANGUAGE TypeOperators #-}\n{-# LANGUAGE RecursiveDo #-}\n{-# LANGUAGE ParallelListComp #-}\n{-# LANGUAGE EmptyDataDecls #-}\n{-# LANGUAGE KindSignatures #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE TypeFamilies #-}"}])]
+ tests/examples/Pragma5.hs view
@@ -0,0 +1,1 @@+{-# LANGUAGE NoMonomorphismRestriction, GADTs, NoMonomorphismRestriction #-}
+ tests/examples/Pragma5.hs.expected view
@@ -0,0 +1,1 @@+{-# LANGUAGE NoMonomorphismRestriction, GADTs #-}
+ tests/examples/Pragma5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma5.hs:1:1: Error: Use better pragmas\nFound:\n  {-# LANGUAGE NoMonomorphismRestriction, GADTs,\n    NoMonomorphismRestriction #-}\nWhy not:\n  {-# LANGUAGE NoMonomorphismRestriction, GADTs #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 77}, newComment = "{-# LANGUAGE NoMonomorphismRestriction, GADTs #-}"}]),("tests/examples/Pragma5.hs:1:1: Error: Unused LANGUAGE pragma\nFound:\n  {-# LANGUAGE NoMonomorphismRestriction, GADTs,\n    NoMonomorphismRestriction #-}\nWhy not:\n  {-# LANGUAGE NoMonomorphismRestriction, GADTs #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 77}, newComment = "{-# LANGUAGE NoMonomorphismRestriction, GADTs #-}"}])]
+ tests/examples/Pragma6.hs view
@@ -0,0 +1,1 @@+{-# LANGUAGE GADTs #-}
+ tests/examples/Pragma6.hs.expected view
@@ -0,0 +1,1 @@+{-# LANGUAGE GADTs #-}
+ tests/examples/Pragma6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Pragma7.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -XGADTs -main-is Baz #-}
+ tests/examples/Pragma7.hs.expected view
@@ -0,0 +1,2 @@+{-# OPTIONS_GHC -main-is Baz #-}+{-# LANGUAGE GADTs #-}
+ tests/examples/Pragma7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma7.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS_GHC -XGADTs -main-is Baz  #-}\nWhy not:\n  {-# LANGUAGE GADTs #-}\n  {-# OPTIONS_GHC -main-is Baz #-}\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 41}, newComment = "{-# OPTIONS_GHC -main-is Baz #-}\n{-# LANGUAGE GADTs #-}"}])]
+ tests/examples/Pragma8.hs view
@@ -0,0 +1,2 @@+{-# OPTIONS_GHC -XGADTs #-}+{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
+ tests/examples/Pragma8.hs.expected view
@@ -0,0 +1,2 @@++{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
+ tests/examples/Pragma8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Pragma8.hs:1:1: Error: Use better pragmas\nFound:\n  {-# OPTIONS_GHC -XGADTs  #-}\nWhy not remove it.\n",[ModifyComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 28}, newComment = ""}])]
+ tests/examples/Pragma9.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE DataKinds #-}
+ tests/examples/Pragma9.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE DataKinds #-}
+ tests/examples/Pragma9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/RedundantDo.hs view
@@ -0,0 +1,4 @@+foo = do+  case x of+    True -> foo+    False -> foo
+ tests/examples/RedundantDo.hs.expected view
@@ -0,0 +1,4 @@+foo =+  case x of+    True -> foo+    False -> foo
+ tests/examples/RedundantDo.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/RedundantDo.hs:1:7: Error: Redundant do\nFound:\n  do case x of\n         True -> foo\n         False -> foo\nWhy not:\n  case x of\n      True -> foo\n      False -> foo\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 4, endCol = 17}, subts = [("y",SrcSpan {startLine = 2, startCol = 3, endLine = 4, endCol = 17})], orig = "y"}]),("tests/examples/RedundantDo.hs:2:3: Warning: Use if\nFound:\n  case x of\n      True -> foo\n      False -> foo\nWhy not:\n  if x then foo else foo\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 2, startCol = 3, endLine = 4, endCol = 17}, subts = [("a",SrcSpan {startLine = 2, startCol = 8, endLine = 2, endCol = 9}),("f",SrcSpan {startLine = 4, startCol = 14, endLine = 4, endCol = 17}),("t",SrcSpan {startLine = 3, startCol = 13, endLine = 3, endCol = 16})], orig = "if a then t else f"}])]
+ tests/examples/Remote.hs view
@@ -0,0 +1,115 @@++{- | Client inner-loop++     This function is generally only needed if you are adding a new communication channel.+-}+processRemoteState :: IsAcidic st =>+                      IO CommChannel -- ^ (re-)connect function+                   -> IO (AcidState st)+processRemoteState reconnect+  = do cmdQueue    <- atomically newTQueue+       ccTMV       <- atomically newEmptyTMVar+       isClosed    <- newIORef False++       let actor :: Command -> IO (MVar Response)+           actor command =+               do debugStrLn "actor: begin."+                  readIORef isClosed >>= flip when (throwIO AcidStateClosed)+                  ref <- newEmptyMVar+                  atomically $ writeTQueue cmdQueue (command, ref)+                  debugStrLn "actor: end."+                  return ref++           expireQueue listenQueue =+               do mCallback <- atomically $ tryReadTQueue listenQueue+                  case mCallback of+                    Nothing         -> return ()+                    (Just callback) ->+                        do callback ConnectionError+                           expireQueue listenQueue++           handleReconnect :: SomeException -> IO ()+           handleReconnect e+             = case fromException e of+                 (Just ThreadKilled) ->+                     do debugStrLn "handleReconnect: ThreadKilled. Not attempting to reconnect."+                        return ()+                 _ ->+                   do debugStrLn $ "handleReconnect begin."+                      tmv <- atomically $ tryTakeTMVar ccTMV+                      case tmv of+                        Nothing ->+                            do debugStrLn $ "handleReconnect: error handling already in progress."+                               debugStrLn $ "handleReconnect end."+                               return ()+                        (Just (oldCC, oldListenQueue, oldListenerTID)) ->+                            do thisTID <- myThreadId+                               when (thisTID /= oldListenerTID) (killThread oldListenerTID)+                               ccClose oldCC+                               expireQueue oldListenQueue+                               cc <- reconnect+                               listenQueue <- atomically $ newTQueue+                               listenerTID <- forkIO $ listener cc listenQueue+                               atomically $ putTMVar ccTMV (cc, listenQueue, listenerTID)+                               debugStrLn $ "handleReconnect end."+                               return ()++           listener :: CommChannel -> TQueue (Response -> IO ()) -> IO ()+           listener cc listenQueue+             = getResponse Strict.empty `catch` handleReconnect+               where+                 getResponse leftover =+                     do debugStrLn $ "listener: listening for Response."+                        let go inp = case inp of+                                   Fail msg _     -> error msg+                                   Partial cont   -> do debugStrLn $ "listener: ccGetSome"+                                                        bs <- ccGetSome cc 1024+                                                        go (cont bs)+                                   Done resp rest -> do debugStrLn $ "listener: getting callback"+                                                        callback <- atomically $ readTQueue listenQueue+                                                        debugStrLn $ "listener: passing Response to callback"+                                                        callback (resp :: Response)+                                                        return rest+                        rest <- go (runGetPartial get leftover) -- `catch` (\e -> do handleReconnect e+                                                                --                   throwIO e+                                                                 --        )+                        getResponse rest++           actorThread :: IO ()+           actorThread = forever $+             do debugStrLn "actorThread: waiting for something to do."+                (cc, cmd) <- atomically $+                  do (cmd, ref)        <- readTQueue cmdQueue+                     (cc, listenQueue, _) <- readTMVar ccTMV+                     writeTQueue listenQueue (putMVar ref)+                     return (cc, cmd)+                debugStrLn "actorThread: sending command."+                ccPut cc (encode cmd) `catch` handleReconnect+                debugStrLn "actorThread: sent."+                return ()++           shutdown :: ThreadId -> IO ()+           shutdown actorTID =+               do debugStrLn "shutdown: update isClosed IORef to True."+                  writeIORef isClosed True+                  debugStrLn "shutdown: killing actor thread."+                  killThread actorTID+                  debugStrLn "shutdown: taking ccTMV."+                  (cc, listenQueue, listenerTID) <- atomically $ takeTMVar ccTMV -- FIXME: or should this by tryTakeTMVar+                  debugStrLn "shutdown: killing listener thread."+                  killThread listenerTID+                  debugStrLn "shutdown: expiring listen queue."+                  expireQueue  listenQueue+                  debugStrLn "shutdown: closing connection."+                  ccClose cc+                  return ()++       cc <- reconnect+       listenQueue <- atomically $ newTQueue++       actorTID    <- forkIO $ actorThread+       listenerTID <- forkIO $ listener cc listenQueue++       atomically $ putTMVar ccTMV (cc, listenQueue, listenerTID)++       return (toAcidState $ RemoteState actor (shutdown actorTID))
+ tests/examples/Remote.hs.expected view
@@ -0,0 +1,115 @@++{- | Client inner-loop++     This function is generally only needed if you are adding a new communication channel.+-}+processRemoteState :: IsAcidic st =>+                      IO CommChannel -- ^ (re-)connect function+                   -> IO (AcidState st)+processRemoteState reconnect+  = do cmdQueue    <- atomically newTQueue+       ccTMV       <- atomically newEmptyTMVar+       isClosed    <- newIORef False++       let actor :: Command -> IO (MVar Response)+           actor command =+               do debugStrLn "actor: begin."+                  readIORef isClosed >>= flip when (throwIO AcidStateClosed)+                  ref <- newEmptyMVar+                  atomically $ writeTQueue cmdQueue (command, ref)+                  debugStrLn "actor: end."+                  return ref++           expireQueue listenQueue =+               do mCallback <- atomically $ tryReadTQueue listenQueue+                  case mCallback of+                    Nothing         -> return ()+                    (Just callback) ->+                        do callback ConnectionError+                           expireQueue listenQueue++           handleReconnect :: SomeException -> IO ()+           handleReconnect e+             = case fromException e of+                 (Just ThreadKilled) ->+                     do debugStrLn "handleReconnect: ThreadKilled. Not attempting to reconnect."+                        return ()+                 _ ->+                   do debugStrLn "handleReconnect begin."+                      tmv <- atomically $ tryTakeTMVar ccTMV+                      case tmv of+                        Nothing ->+                            do debugStrLn "handleReconnect: error handling already in progress."+                               debugStrLn "handleReconnect end."+                               return ()+                        (Just (oldCC, oldListenQueue, oldListenerTID)) ->+                            do thisTID <- myThreadId+                               when (thisTID /= oldListenerTID) (killThread oldListenerTID)+                               ccClose oldCC+                               expireQueue oldListenQueue+                               cc <- reconnect+                               listenQueue <- atomically newTQueue+                               listenerTID <- forkIO $ listener cc listenQueue+                               atomically $ putTMVar ccTMV (cc, listenQueue, listenerTID)+                               debugStrLn "handleReconnect end."+                               return ()++           listener :: CommChannel -> TQueue (Response -> IO ()) -> IO ()+           listener cc listenQueue+             = getResponse Strict.empty `catch` handleReconnect+               where+                 getResponse leftover =+                     do debugStrLn "listener: listening for Response."+                        let go inp = case inp of+                                   Fail msg _     -> error msg+                                   Partial cont   -> do debugStrLn "listener: ccGetSome"+                                                        bs <- ccGetSome cc 1024+                                                        go (cont bs)+                                   Done resp rest -> do debugStrLn "listener: getting callback"+                                                        callback <- atomically $ readTQueue listenQueue+                                                        debugStrLn "listener: passing Response to callback"+                                                        callback (resp :: Response)+                                                        return rest+                        rest <- go (runGetPartial get leftover) -- `catch` (\e -> do handleReconnect e+                                                                --                   throwIO e+                                                                 --        )+                        getResponse rest++           actorThread :: IO ()+           actorThread = forever $+             do debugStrLn "actorThread: waiting for something to do."+                (cc, cmd) <- atomically $+                  do (cmd, ref)        <- readTQueue cmdQueue+                     (cc, listenQueue, _) <- readTMVar ccTMV+                     writeTQueue listenQueue (putMVar ref)+                     return (cc, cmd)+                debugStrLn "actorThread: sending command."+                ccPut cc (encode cmd) `catch` handleReconnect+                debugStrLn "actorThread: sent."+                return ()++           shutdown :: ThreadId -> IO ()+           shutdown actorTID =+               do debugStrLn "shutdown: update isClosed IORef to True."+                  writeIORef isClosed True+                  debugStrLn "shutdown: killing actor thread."+                  killThread actorTID+                  debugStrLn "shutdown: taking ccTMV."+                  (cc, listenQueue, listenerTID) <- atomically $ takeTMVar ccTMV -- FIXME: or should this by tryTakeTMVar+                  debugStrLn "shutdown: killing listener thread."+                  killThread listenerTID+                  debugStrLn "shutdown: expiring listen queue."+                  expireQueue  listenQueue+                  debugStrLn "shutdown: closing connection."+                  ccClose cc+                  return ()++       cc <- reconnect+       listenQueue <- atomically newTQueue++       actorTID    <- forkIO actorThread+       listenerTID <- forkIO $ listener cc listenQueue++       atomically $ putTMVar ccTMV (cc, listenQueue, listenerTID)++       return (toAcidState $ RemoteState actor (shutdown actorTID))
+ tests/examples/Remote.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Remote.hs:38:23: Warning: Redundant $\nFound:\n  debugStrLn $ \"handleReconnect begin.\"\nWhy not:\n  debugStrLn \"handleReconnect begin.\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 38, startCol = 23, endLine = 38, endCol = 60}, subts = [("a",SrcSpan {startLine = 38, startCol = 23, endLine = 38, endCol = 33}),("b",SrcSpan {startLine = 38, startCol = 36, endLine = 38, endCol = 60})], orig = "a b"}]),("tests/examples/Remote.hs:42:32: Warning: Redundant $\nFound:\n  debugStrLn $ \"handleReconnect: error handling already in progress.\"\nWhy not:\n  debugStrLn \"handleReconnect: error handling already in progress.\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 42, startCol = 32, endLine = 42, endCol = 99}, subts = [("a",SrcSpan {startLine = 42, startCol = 32, endLine = 42, endCol = 42}),("b",SrcSpan {startLine = 42, startCol = 45, endLine = 42, endCol = 99})], orig = "a b"}]),("tests/examples/Remote.hs:43:32: Warning: Redundant $\nFound:\n  debugStrLn $ \"handleReconnect end.\"\nWhy not:\n  debugStrLn \"handleReconnect end.\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 43, startCol = 32, endLine = 43, endCol = 67}, subts = [("a",SrcSpan {startLine = 43, startCol = 32, endLine = 43, endCol = 42}),("b",SrcSpan {startLine = 43, startCol = 45, endLine = 43, endCol = 67})], orig = "a b"}]),("tests/examples/Remote.hs:51:47: Warning: Redundant $\nFound:\n  atomically $ newTQueue\nWhy not:\n  atomically newTQueue\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 51, startCol = 47, endLine = 51, endCol = 69}, subts = [("a",SrcSpan {startLine = 51, startCol = 47, endLine = 51, endCol = 57}),("b",SrcSpan {startLine = 51, startCol = 60, endLine = 51, endCol = 69})], orig = "a b"}]),("tests/examples/Remote.hs:54:32: Warning: Redundant $\nFound:\n  debugStrLn $ \"handleReconnect end.\"\nWhy not:\n  debugStrLn \"handleReconnect end.\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 54, startCol = 32, endLine = 54, endCol = 67}, subts = [("a",SrcSpan {startLine = 54, startCol = 32, endLine = 54, endCol = 42}),("b",SrcSpan {startLine = 54, startCol = 45, endLine = 54, endCol = 67})], orig = "a b"}]),("tests/examples/Remote.hs:62:25: Warning: Redundant $\nFound:\n  debugStrLn $ \"listener: listening for Response.\"\nWhy not:\n  debugStrLn \"listener: listening for Response.\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 62, startCol = 25, endLine = 62, endCol = 73}, subts = [("a",SrcSpan {startLine = 62, startCol = 25, endLine = 62, endCol = 35}),("b",SrcSpan {startLine = 62, startCol = 38, endLine = 62, endCol = 73})], orig = "a b"}]),("tests/examples/Remote.hs:65:57: Warning: Redundant $\nFound:\n  debugStrLn $ \"listener: ccGetSome\"\nWhy not:\n  debugStrLn \"listener: ccGetSome\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 65, startCol = 57, endLine = 65, endCol = 91}, subts = [("a",SrcSpan {startLine = 65, startCol = 57, endLine = 65, endCol = 67}),("b",SrcSpan {startLine = 65, startCol = 70, endLine = 65, endCol = 91})], orig = "a b"}]),("tests/examples/Remote.hs:68:57: Warning: Redundant $\nFound:\n  debugStrLn $ \"listener: getting callback\"\nWhy not:\n  debugStrLn \"listener: getting callback\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 68, startCol = 57, endLine = 68, endCol = 98}, subts = [("a",SrcSpan {startLine = 68, startCol = 57, endLine = 68, endCol = 67}),("b",SrcSpan {startLine = 68, startCol = 70, endLine = 68, endCol = 98})], orig = "a b"}]),("tests/examples/Remote.hs:70:57: Warning: Redundant $\nFound:\n  debugStrLn $ \"listener: passing Response to callback\"\nWhy not:\n  debugStrLn \"listener: passing Response to callback\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 70, startCol = 57, endLine = 70, endCol = 110}, subts = [("a",SrcSpan {startLine = 70, startCol = 57, endLine = 70, endCol = 67}),("b",SrcSpan {startLine = 70, startCol = 70, endLine = 70, endCol = 110})], orig = "a b"}]),("tests/examples/Remote.hs:108:23: Warning: Redundant $\nFound:\n  atomically $ newTQueue\nWhy not:\n  atomically newTQueue\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 108, startCol = 23, endLine = 108, endCol = 45}, subts = [("a",SrcSpan {startLine = 108, startCol = 23, endLine = 108, endCol = 33}),("b",SrcSpan {startLine = 108, startCol = 36, endLine = 108, endCol = 45})], orig = "a b"}]),("tests/examples/Remote.hs:110:23: Warning: Redundant $\nFound:\n  forkIO $ actorThread\nWhy not:\n  forkIO actorThread\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 110, startCol = 23, endLine = 110, endCol = 43}, subts = [("a",SrcSpan {startLine = 110, startCol = 23, endLine = 110, endCol = 29}),("b",SrcSpan {startLine = 110, startCol = 32, endLine = 110, endCol = 43})], orig = "a b"}])]
+ tests/examples/Sequence.hs view
@@ -0,0 +1,9 @@+-- | The 'mapAndUnzipM' function maps its first argument over a list, returning+-- the result as a pair of lists. This function is mainly used with complicated+-- data structures or a state-transforming monad.+mapAndUnzipM      :: (Monad m) => (a -> m (b,c)) -> [a] -> m ([b], [c])+{-# INLINE mapAndUnzipM #-}+mapAndUnzipM f xs =  sequence (map f xs) >>= return . foo++ren = (run (foo) run)+
+ tests/examples/Sequence.hs.expected view
@@ -0,0 +1,9 @@+-- | The 'mapAndUnzipM' function maps its first argument over a list, returning+-- the result as a pair of lists. This function is mainly used with complicated+-- data structures or a state-transforming monad.+mapAndUnzipM      :: (Monad m) => (a -> m (b,c)) -> [a] -> m ([b], [c])+{-# INLINE mapAndUnzipM #-}+mapAndUnzipM f xs =  Control.Monad.liftM foo (sequence (map f xs))++ren = run (foo) run+
+ tests/examples/Sequence.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Sequence.hs:6:22: Error: Use mapM\nFound:\n  sequence (map f xs)\nWhy not:\n  mapM f xs\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 6, startCol = 22, endLine = 6, endCol = 41}, subts = [("f",SrcSpan {startLine = 6, startCol = 36, endLine = 6, endCol = 37}),("x",SrcSpan {startLine = 6, startCol = 38, endLine = 6, endCol = 40})], orig = "mapM f x"}]),("tests/examples/Sequence.hs:6:22: Warning: Use liftM\nFound:\n  sequence (map f xs) >>= return . foo\nWhy not:\n  Control.Monad.liftM foo (sequence (map f xs))\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 6, startCol = 22, endLine = 6, endCol = 58}, subts = [("f",SrcSpan {startLine = 6, startCol = 55, endLine = 6, endCol = 58}),("m",SrcSpan {startLine = 6, startCol = 22, endLine = 6, endCol = 41})], orig = "Control.Monad.liftM f (m)"}]),("tests/examples/Sequence.hs:8:7: Warning: Redundant bracket\nFound:\n  (run (foo) run)\nWhy not:\n  run (foo) run\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 8, startCol = 7, endLine = 8, endCol = 22}, subts = [("x",SrcSpan {startLine = 8, startCol = 8, endLine = 8, endCol = 21})], orig = "x"}]),("tests/examples/Sequence.hs:8:12: Error: Redundant bracket\nFound:\n  (foo)\nWhy not:\n  foo\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 8, startCol = 12, endLine = 8, endCol = 17}, subts = [("x",SrcSpan {startLine = 8, startCol = 13, endLine = 8, endCol = 16})], orig = "x"}])]
+ tests/examples/Structure0.hs view
@@ -0,0 +1,1 @@+yes x y = if a then b else if c then d else e
+ tests/examples/Structure0.hs.expected view
@@ -0,0 +1,4 @@+yes x y+  | a = b+  | c = d+  | otherwise = e
+ tests/examples/Structure0.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure0.hs:1:1: Warning: Use guards\nFound:\n  yes x y = if a then b else if c then d else e\nWhy not:\n  yes x y\n    | a = b\n    | c = d\n    | otherwise = e\n",[Replace {rtype = Match, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 46}, subts = [("p1001",SrcSpan {startLine = 1, startCol = 5, endLine = 1, endCol = 6}),("p1002",SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 8}),("g1001",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 15}),("g1002",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 32}),("e1001",SrcSpan {startLine = 1, startCol = 21, endLine = 1, endCol = 22}),("e1002",SrcSpan {startLine = 1, startCol = 38, endLine = 1, endCol = 39}),("e1003",SrcSpan {startLine = 1, startCol = 45, endLine = 1, endCol = 46})], orig = "yes p1001 p1002\n  | g1001 = e1001\n  | g1002 = e1002\n  | otherwise = e1003"}])]
+ tests/examples/Structure1.hs view
@@ -0,0 +1,1 @@+x `yes` y = if a then b else if c then d else e
+ tests/examples/Structure1.hs.expected view
@@ -0,0 +1,4 @@+yes x y+  | a = b+  | c = d+  | otherwise = e
+ tests/examples/Structure1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure1.hs:1:1: Warning: Use guards\nFound:\n  yes x y = if a then b else if c then d else e\nWhy not:\n  yes x y\n    | a = b\n    | c = d\n    | otherwise = e\n",[Replace {rtype = Match, pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 48}, subts = [("p1001",SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 2}),("p1002",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 10}),("g1001",SrcSpan {startLine = 1, startCol = 16, endLine = 1, endCol = 17}),("g1002",SrcSpan {startLine = 1, startCol = 33, endLine = 1, endCol = 34}),("e1001",SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 24}),("e1002",SrcSpan {startLine = 1, startCol = 40, endLine = 1, endCol = 41}),("e1003",SrcSpan {startLine = 1, startCol = 47, endLine = 1, endCol = 48})], orig = "yes p1001 p1002\n  | g1001 = e1001\n  | g1002 = e1002\n  | otherwise = e1003"}])]
+ tests/examples/Structure10.hs view
@@ -0,0 +1,1 @@+foo (Bar _ _ _ _) = x
+ tests/examples/Structure10.hs.expected view
@@ -0,0 +1,1 @@+foo (Bar{}) = x
+ tests/examples/Structure10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure10.hs:1:6: Warning: Use record patterns\nFound:\n  Bar _ _ _ _\nWhy not:\n  Bar{}\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 1, startCol = 6, endLine = 1, endCol = 17}, subts = [], orig = "Bar{}"}])]
+ tests/examples/Structure11.hs view
@@ -0,0 +1,1 @@+foo (Bar _ x _ _) = x
+ tests/examples/Structure11.hs.expected view
@@ -0,0 +1,1 @@+foo (Bar _ x _ _) = x
+ tests/examples/Structure11.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure12.hs view
@@ -0,0 +1,1 @@+foo (Bar _ _) = x
+ tests/examples/Structure12.hs.expected view
@@ -0,0 +1,1 @@+foo (Bar _ _) = x
+ tests/examples/Structure12.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure13.hs view
@@ -0,0 +1,1 @@+foo = case f v of _ -> x
+ tests/examples/Structure13.hs.expected view
@@ -0,0 +1,1 @@+foo = x
+ tests/examples/Structure13.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure13.hs:1:7: Warning: Redundant case\nFound:\n  case f v of\n      _ -> x\nWhy not:\n  x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 25}, subts = [("x",SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 25})], orig = "x"}])]
+ tests/examples/Structure14.hs view
@@ -0,0 +1,1 @@+foo = case v of v -> x
+ tests/examples/Structure14.hs.expected view
@@ -0,0 +1,1 @@+foo = x
+ tests/examples/Structure14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure14.hs:1:7: Warning: Redundant case\nFound:\n  case v of\n      v -> x\nWhy not:\n  x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 22, endLine = 1, endCol = 23})], orig = "x"}])]
+ tests/examples/Structure15.hs view
@@ -0,0 +1,1 @@+foo = case v of z -> z
+ tests/examples/Structure15.hs.expected view
@@ -0,0 +1,1 @@+foo = case v of z -> z
+ tests/examples/Structure15.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure16.hs view
@@ -0,0 +1,1 @@+foo = case v of _ | False -> x
+ tests/examples/Structure16.hs.expected view
@@ -0,0 +1,1 @@+foo = case v of _ | False -> x
+ tests/examples/Structure16.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure17.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !True -> x
+ tests/examples/Structure17.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of True -> x
+ tests/examples/Structure17.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure17.hs:2:17: Error: Redundant bang pattern\nFound:\n  !True\nWhy not:\n  True\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 2, startCol = 17, endLine = 2, endCol = 22}, subts = [("x",SrcSpan {startLine = 2, startCol = 18, endLine = 2, endCol = 22})], orig = "x"}])]
+ tests/examples/Structure18.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !(Just x) -> x
+ tests/examples/Structure18.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of (Just x) -> x
+ tests/examples/Structure18.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure18.hs:2:17: Error: Redundant bang pattern\nFound:\n  !(Just x)\nWhy not:\n  (Just x)\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 2, startCol = 17, endLine = 2, endCol = 26}, subts = [("x",SrcSpan {startLine = 2, startCol = 18, endLine = 2, endCol = 26})], orig = "x"}])]
+ tests/examples/Structure19.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !(x : xs) -> x
+ tests/examples/Structure19.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of (x : xs) -> x
+ tests/examples/Structure19.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure19.hs:2:17: Error: Redundant bang pattern\nFound:\n  !(x : xs)\nWhy not:\n  (x : xs)\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 2, startCol = 17, endLine = 2, endCol = 26}, subts = [("x",SrcSpan {startLine = 2, startCol = 18, endLine = 2, endCol = 26})], orig = "x"}])]
+ tests/examples/Structure2.hs view
@@ -0,0 +1,1 @@+no x y = if a then b else c
+ tests/examples/Structure2.hs.expected view
@@ -0,0 +1,1 @@+no x y = if a then b else c
+ tests/examples/Structure2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure20.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !1 -> x
+ tests/examples/Structure20.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of 1 -> x
+ tests/examples/Structure20.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure20.hs:2:17: Error: Redundant bang pattern\nFound:\n  !1\nWhy not:\n  1\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 2, startCol = 17, endLine = 2, endCol = 19}, subts = [("x",SrcSpan {startLine = 2, startCol = 18, endLine = 2, endCol = 19})], orig = "x"}])]
+ tests/examples/Structure21.hs view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !x -> x
+ tests/examples/Structure21.hs.expected view
@@ -0,0 +1,2 @@+{-# LANGUAGE BangPatterns #-}+foo = case v of !x -> x
+ tests/examples/Structure21.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure22.hs view
@@ -0,0 +1,1 @@+foo = let ~x = 1 in y
+ tests/examples/Structure22.hs.expected view
@@ -0,0 +1,1 @@+foo = let x = 1 in y
+ tests/examples/Structure22.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure22.hs:1:11: Error: Redundant irrefutable pattern\nFound:\n  ~x\nWhy not:\n  x\n",[Replace {rtype = Pattern, pos = SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 13}, subts = [("x",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 13})], orig = "x"}])]
+ tests/examples/Structure23.hs view
@@ -0,0 +1,1 @@+foo = let ~(x:xs) = y in z
+ tests/examples/Structure23.hs.expected view
@@ -0,0 +1,1 @@+foo = let ~(x:xs) = y in z
+ tests/examples/Structure23.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure3.hs view
@@ -0,0 +1,1 @@+foo b | c <- f b = c + b
+ tests/examples/Structure3.hs.expected view
@@ -0,0 +1,1 @@+foo b | c <- f b = c + b
+ tests/examples/Structure3.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure4.hs view
@@ -0,0 +1,1 @@+foo b | c <- f b = c where f = here
+ tests/examples/Structure4.hs.expected view
@@ -0,0 +1,1 @@+foo b | c <- f b = c where f = here
+ tests/examples/Structure4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure5.hs view
@@ -0,0 +1,1 @@+foo b | c <- f b = c where foo = b
+ tests/examples/Structure5.hs.expected view
@@ -0,0 +1,1 @@+foo b | c <- f b = c where foo = b
+ tests/examples/Structure5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure6.hs view
@@ -0,0 +1,2 @@+foo b | c <- f b = c +      | c <- f b = c
+ tests/examples/Structure6.hs.expected view
@@ -0,0 +1,2 @@+foo b | c <- f b = c+      | c <- f b = c
+ tests/examples/Structure6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Structure7.hs view
@@ -0,0 +1,1 @@+foo x = yes x x where yes x y = if a then b else if c then d else e
+ tests/examples/Structure7.hs.expected view
@@ -0,0 +1,4 @@+foo x = yes x x where yes x y+                        | a = b+                        | c = d+                        | otherwise = e
+ tests/examples/Structure7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure7.hs:1:23: Warning: Use guards\nFound:\n  yes x y = if a then b else if c then d else e\nWhy not:\n  yes x y\n    | a = b\n    | c = d\n    | otherwise = e\n",[Replace {rtype = Match, pos = SrcSpan {startLine = 1, startCol = 23, endLine = 1, endCol = 68}, subts = [("p1001",SrcSpan {startLine = 1, startCol = 27, endLine = 1, endCol = 28}),("p1002",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 30}),("g1001",SrcSpan {startLine = 1, startCol = 36, endLine = 1, endCol = 37}),("g1002",SrcSpan {startLine = 1, startCol = 53, endLine = 1, endCol = 54}),("e1001",SrcSpan {startLine = 1, startCol = 43, endLine = 1, endCol = 44}),("e1002",SrcSpan {startLine = 1, startCol = 60, endLine = 1, endCol = 61}),("e1003",SrcSpan {startLine = 1, startCol = 67, endLine = 1, endCol = 68})], orig = "yes p1001 p1002\n  | g1001 = e1001\n  | g1002 = e1002\n  | otherwise = e1003"}])]
+ tests/examples/Structure8.hs view
@@ -0,0 +1,1 @@+foo x | otherwise = y
+ tests/examples/Structure8.hs.expected view
@@ -0,0 +1,1 @@+foo x  = y
+ tests/examples/Structure8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure8.hs:1:1: Warning: Redundant guard\nFound:\n  foo x | otherwise = y\nWhy not:\n  foo x = y\n",[Delete {rtype = Stmt, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 18}}])]
+ tests/examples/Structure9.hs view
@@ -0,0 +1,1 @@+foo x | a = b | True = d
+ tests/examples/Structure9.hs.expected view
@@ -0,0 +1,1 @@+foo x | a = b | otherwise = d
+ tests/examples/Structure9.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Structure9.hs:1:1: Warning: Use otherwise\nFound:\n  foo x\n    | a = b\n    | True = d\nWhy not:\n  foo x\n    | a = b\n    | otherwise = d\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 21}, subts = [], orig = "otherwise"}])]
+ tests/examples/Test0.hs view
@@ -0,0 +1,2 @@+main = readFile "foo" >>= putStr            + 
+ tests/examples/Test0.hs.expected view
@@ -0,0 +1,2 @@+main = readFile "foo" >>= putStr+
+ tests/examples/Test0.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test1.hs view
@@ -0,0 +1,3 @@+import Prelude hiding(readFile)             +import Data.ByteString.Char8(readFile)      +test = readFile "foo" >>= putStr
+ tests/examples/Test1.hs.expected view
@@ -0,0 +1,3 @@+import Prelude hiding(readFile)+import Data.ByteString.Char8(readFile)+test = readFile "foo" >>= putStr
+ tests/examples/Test1.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test10.hs view
@@ -0,0 +1,1 @@+type Ignore_Test = Int
+ tests/examples/Test10.hs.expected view
@@ -0,0 +1,1 @@+type Ignore_Test = Int
+ tests/examples/Test10.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test10.hs:1:1: Warning: Use camelCase\nFound:\n  type Ignore_Test = Int\nWhy not:\n  type IgnoreTest = Int\n",[])]
+ tests/examples/Test11.hs view
@@ -0,0 +1,1 @@+annTest = foldl
+ tests/examples/Test11.hs.expected view
@@ -0,0 +1,1 @@+annTest = foldl
+ tests/examples/Test11.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test12.hs view
@@ -0,0 +1,1 @@+annTest2 = foldl
+ tests/examples/Test12.hs.expected view
@@ -0,0 +1,1 @@+annTest2 = foldl
+ tests/examples/Test12.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test13.hs view
@@ -0,0 +1,1 @@+annTest3 = scanr
+ tests/examples/Test13.hs.expected view
@@ -0,0 +1,1 @@+annTest3 = scanr
+ tests/examples/Test13.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test14.hs view
@@ -0,0 +1,1 @@+type Ann_Test = Int
+ tests/examples/Test14.hs.expected view
@@ -0,0 +1,1 @@+type Ann_Test = Int
+ tests/examples/Test14.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test14.hs:1:1: Warning: Use camelCase\nFound:\n  type Ann_Test = Int\nWhy not:\n  type AnnTest = Int\n",[])]
+ tests/examples/Test15.hs view
@@ -0,0 +1,1 @@+concatMap f x = concat (map f x)
+ tests/examples/Test15.hs.expected view
@@ -0,0 +1,1 @@+concatMap f x = concat (map f x)
+ tests/examples/Test15.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test16.hs view
@@ -0,0 +1,1 @@+concatMop f x = concat (map f x)
+ tests/examples/Test16.hs.expected view
@@ -0,0 +1,1 @@+concatMop f x = concatMap f x
+ tests/examples/Test16.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test16.hs:1:17: Error: Use concatMap\nFound:\n  concat (map f x)\nWhy not:\n  concatMap f x\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 17, endLine = 1, endCol = 33}, subts = [("f",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 30}),("x",SrcSpan {startLine = 1, startCol = 31, endLine = 1, endCol = 32})], orig = "concatMap f x"}])]
+ tests/examples/Test17.hs view
@@ -0,0 +1,1 @@+yes = 1 * 2+3
+ tests/examples/Test17.hs.expected view
@@ -0,0 +1,1 @@+yes = 1 * 2+3
+ tests/examples/Test17.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test18.hs view
@@ -0,0 +1,1 @@+import Foo; test = Foo.id 1
+ tests/examples/Test18.hs.expected view
@@ -0,0 +1,1 @@+import Foo; test = Foo.id 1
+ tests/examples/Test18.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test19.hs view
@@ -0,0 +1,1 @@+test = head
+ tests/examples/Test19.hs.expected view
@@ -0,0 +1,1 @@+test = head
+ tests/examples/Test19.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test2.hs view
@@ -0,0 +1,3 @@+import Prelude as Prelude2                  +yes = Prelude2.readFile "foo" >>= putStr    + 
+ tests/examples/Test2.hs.expected view
@@ -0,0 +1,3 @@+import Prelude as Prelude2+yes = Prelude2.readFile "foo" >>= putStr+
+ tests/examples/Test2.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test20.hs view
@@ -0,0 +1,1 @@+import Array; test = Array.head
+ tests/examples/Test20.hs.expected view
@@ -0,0 +1,1 @@+import Array; test = Array.head
+ tests/examples/Test20.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test21.hs view
@@ -0,0 +1,1 @@+test = Array.head
+ tests/examples/Test21.hs.expected view
@@ -0,0 +1,1 @@+test = Array.head
+ tests/examples/Test21.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test22.hs view
@@ -0,0 +1,1 @@+test = head
+ tests/examples/Test22.hs.expected view
@@ -0,0 +1,1 @@+test = head
+ tests/examples/Test22.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test23.hs view
@@ -0,0 +1,1 @@+import qualified Array; test = head
+ tests/examples/Test23.hs.expected view
@@ -0,0 +1,1 @@+import qualified Array; test = head
+ tests/examples/Test23.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test24.hs view
@@ -0,0 +1,1 @@+import Array(tail); test = head
+ tests/examples/Test24.hs.expected view
@@ -0,0 +1,1 @@+import Array(tail); test = head
+ tests/examples/Test24.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test25.hs view
@@ -0,0 +1,1 @@+import Array(head); test = head
+ tests/examples/Test25.hs.expected view
@@ -0,0 +1,1 @@+import Array(head); test = head
+ tests/examples/Test25.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test26.hs view
@@ -0,0 +1,1 @@+import Array as A; test = A.head
+ tests/examples/Test26.hs.expected view
@@ -0,0 +1,1 @@+import Array as A; test = A.head
+ tests/examples/Test26.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test27.hs view
@@ -0,0 +1,1 @@+test = tail
+ tests/examples/Test27.hs.expected view
@@ -0,0 +1,1 @@+test = tail
+ tests/examples/Test27.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test28.hs view
@@ -0,0 +1,1 @@+import qualified Array as B; test = tail
+ tests/examples/Test28.hs.expected view
@@ -0,0 +1,1 @@+import qualified Array as B; test = tail
+ tests/examples/Test28.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test29.hs view
@@ -0,0 +1,1 @@+import Control.Arrow; test = id *** id
+ tests/examples/Test29.hs.expected view
@@ -0,0 +1,1 @@+import Control.Arrow; test = second id
+ tests/examples/Test29.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test29.hs:1:30: Error: Use second\nFound:\n  id *** id\nWhy not:\n  second id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 39}, subts = [("g",SrcSpan {startLine = 1, startCol = 37, endLine = 1, endCol = 39})], orig = "second g"}]),("tests/examples/Test29.hs:1:30: Error: Use first\nFound:\n  id *** id\nWhy not:\n  first id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 39}, subts = [("f",SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 32})], orig = "first f"}])]
+ tests/examples/Test3.hs view
@@ -0,0 +1,1 @@+yes = 32 :: Int
+ tests/examples/Test3.hs.expected view
@@ -0,0 +1,1 @@+yes = 32 :: Int
+ tests/examples/Test3.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test30.hs view
@@ -0,0 +1,1 @@+test = id Control.Arrow.*** id
+ tests/examples/Test30.hs.expected view
@@ -0,0 +1,1 @@+test = second id
+ tests/examples/Test30.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test30.hs:1:8: Error: Use second\nFound:\n  id Control.Arrow.*** id\nWhy not:\n  second id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 31}, subts = [("g",SrcSpan {startLine = 1, startCol = 29, endLine = 1, endCol = 31})], orig = "second g"}]),("tests/examples/Test30.hs:1:8: Error: Use first\nFound:\n  id Control.Arrow.*** id\nWhy not:\n  first id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 31}, subts = [("f",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 10})], orig = "first f"}])]
+ tests/examples/Test31.hs view
@@ -0,0 +1,1 @@+import Control.Arrow as Q; test = id Q.*** id
+ tests/examples/Test31.hs.expected view
@@ -0,0 +1,1 @@+import Control.Arrow as Q; test = second id
+ tests/examples/Test31.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Test31.hs:1:35: Error: Use second\nFound:\n  id Q.*** id\nWhy not:\n  second id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 35, endLine = 1, endCol = 46}, subts = [("g",SrcSpan {startLine = 1, startCol = 44, endLine = 1, endCol = 46})], orig = "second g"}]),("tests/examples/Test31.hs:1:35: Error: Use first\nFound:\n  id Q.*** id\nWhy not:\n  first id\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 35, endLine = 1, endCol = 46}, subts = [("f",SrcSpan {startLine = 1, startCol = 35, endLine = 1, endCol = 37})], orig = "first f"}])]
+ tests/examples/Test32.hs view
@@ -0,0 +1,1 @@+zip [1..length x]
+ tests/examples/Test32.hs.expected view
@@ -0,0 +1,1 @@+zip [1..length x]
+ tests/examples/Test32.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test33.hs view
@@ -0,0 +1,1 @@+zip [1..length x] x
+ tests/examples/Test33.hs.expected view
@@ -0,0 +1,1 @@+zip [1..length x] x
+ tests/examples/Test33.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test34.hs view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} +{-# LANGUAGE RecordWildCards #-}
+ tests/examples/Test34.hs.expected view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}+{-# LANGUAGE RecordWildCards #-}
+ tests/examples/Test34.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test35.hs view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} +{-# LANGUAGE RecordWildCards #-}
+ tests/examples/Test35.hs.expected view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}+{-# LANGUAGE RecordWildCards #-}
+ tests/examples/Test35.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test37.hs view
@@ -0,0 +1,2 @@+{-# ANN lam "HLint: ignore Redundant lambda" #-} +lam = \x -> x x x
+ tests/examples/Test37.hs.expected view
@@ -0,0 +1,2 @@+{-# ANN lam "HLint: ignore Redundant lambda" #-}+lam = \x -> x x x
+ tests/examples/Test37.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test38.hs view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Reduce duplication" #-} +dup = do a; a; a; a; a; a
+ tests/examples/Test38.hs.expected view
@@ -0,0 +1,2 @@+{-# ANN module "HLint: ignore Reduce duplication" #-}+dup = do a; a; a; a; a; a
+ tests/examples/Test38.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test4.hs view
@@ -0,0 +1,1 @@+yes = before 12
+ tests/examples/Test4.hs.expected view
@@ -0,0 +1,1 @@+yes = before 12
+ tests/examples/Test4.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test5.hs view
@@ -0,0 +1,1 @@+ignoreTest = filter
+ tests/examples/Test5.hs.expected view
@@ -0,0 +1,1 @@+ignoreTest = filter
+ tests/examples/Test5.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test6.hs view
@@ -0,0 +1,1 @@+ignoreTest2 = filter
+ tests/examples/Test6.hs.expected view
@@ -0,0 +1,1 @@+ignoreTest2 = filter
+ tests/examples/Test6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test7.hs view
@@ -0,0 +1,1 @@+ignoreTest3 = filter
+ tests/examples/Test7.hs.expected view
@@ -0,0 +1,1 @@+ignoreTest3 = filter
+ tests/examples/Test7.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test8.hs view
@@ -0,0 +1,1 @@+ignoreAny = scanr
+ tests/examples/Test8.hs.expected view
@@ -0,0 +1,1 @@+ignoreAny = scanr
+ tests/examples/Test8.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Test9.hs view
@@ -0,0 +1,1 @@+ignoreNew = foldr
+ tests/examples/Test9.hs.expected view
@@ -0,0 +1,1 @@+ignoreNew = foldr
+ tests/examples/Test9.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Uncurry.hs view
@@ -0,0 +1,3 @@+f p = fst p `func` snd p++f p =    fst p .= snd p
+ tests/examples/Uncurry.hs.expected view
@@ -0,0 +1,3 @@+f p = uncurry func p++f p =    uncurry (.=) p
+ tests/examples/Uncurry.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Uncurry.hs:1:7: Error: Evaluate\nFound:\n  fst p `func` snd p\nWhy not:\n  uncurry func p\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 25}, subts = [("f",SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 19}),("p",SrcSpan {startLine = 1, startCol = 11, endLine = 1, endCol = 12})], orig = "uncurry f p"}]),("tests/examples/Uncurry.hs:3:10: Error: Evaluate\nFound:\n  fst p .= snd p\nWhy not:\n  uncurry (.=) p\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 3, startCol = 10, endLine = 3, endCol = 24}, subts = [("f",SrcSpan {startLine = 3, startCol = 16, endLine = 3, endCol = 18}),("p",SrcSpan {startLine = 3, startCol = 14, endLine = 3, endCol = 15})], orig = "uncurry f p"}])]
+ tests/examples/Unsafe0.hs view
@@ -0,0 +1,1 @@+{-# NOINLINE slaves #-}; slaves = unsafePerformIO newIO
+ tests/examples/Unsafe0.hs.expected view
@@ -0,0 +1,1 @@+{-# NOINLINE slaves #-}; slaves = unsafePerformIO newIO
+ tests/examples/Unsafe0.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Unsafe1.hs view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO Multimap.newIO
+ tests/examples/Unsafe1.hs.expected view
@@ -0,0 +1,3 @@++{-# NOINLINE slaves #-}+slaves = unsafePerformIO Multimap.newIO
+ tests/examples/Unsafe1.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe1.hs:1:1: Error: Missing NOINLINE pragma\nFound:\n  slaves = unsafePerformIO Multimap.newIO\nWhy not:\n  {-# NOINLINE slaves #-}\n  slaves = unsafePerformIO Multimap.newIO\n",[InsertComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 40}, newComment = "{-# NOINLINE slaves #-}"}])]
+ tests/examples/Unsafe2.hs view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO $ f y where foo = 1
+ tests/examples/Unsafe2.hs.expected view
@@ -0,0 +1,3 @@++{-# NOINLINE slaves #-}+slaves = unsafePerformIO $ f y where foo = 1
+ tests/examples/Unsafe2.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe2.hs:1:1: Error: Missing NOINLINE pragma\nFound:\n  slaves = unsafePerformIO $ f y\n    where foo = 1\nWhy not:\n  {-# NOINLINE slaves #-}\n  slaves = unsafePerformIO $ f y\n    where foo = 1\n",[InsertComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 45}, newComment = "{-# NOINLINE slaves #-}"}])]
+ tests/examples/Unsafe3.hs view
@@ -0,0 +1,1 @@+slaves v = unsafePerformIO $ Multimap.newIO where foo = 1
+ tests/examples/Unsafe3.hs.expected view
@@ -0,0 +1,1 @@+slaves v = unsafePerformIO Multimap.newIO where foo = 1
+ tests/examples/Unsafe3.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe3.hs:1:12: Warning: Redundant $\nFound:\n  unsafePerformIO $ Multimap.newIO\nWhy not:\n  unsafePerformIO Multimap.newIO\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 44}, subts = [("a",SrcSpan {startLine = 1, startCol = 12, endLine = 1, endCol = 27}),("b",SrcSpan {startLine = 1, startCol = 30, endLine = 1, endCol = 44})], orig = "a b"}])]
+ tests/examples/Unsafe4.hs view
@@ -0,0 +1,1 @@+slaves v = x where x = unsafePerformIO $ Multimap.newIO
+ tests/examples/Unsafe4.hs.expected view
@@ -0,0 +1,1 @@+slaves v = x where x = unsafePerformIO Multimap.newIO
+ tests/examples/Unsafe4.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe4.hs:1:24: Warning: Redundant $\nFound:\n  unsafePerformIO $ Multimap.newIO\nWhy not:\n  unsafePerformIO Multimap.newIO\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 56}, subts = [("a",SrcSpan {startLine = 1, startCol = 24, endLine = 1, endCol = 39}),("b",SrcSpan {startLine = 1, startCol = 42, endLine = 1, endCol = 56})], orig = "a b"}])]
+ tests/examples/Unsafe5.hs view
@@ -0,0 +1,1 @@+slaves = x where x = unsafePerformIO Multimap.newIO
+ tests/examples/Unsafe5.hs.expected view
@@ -0,0 +1,3 @@++{-# NOINLINE slaves #-}+slaves = x where x = unsafePerformIO Multimap.newIO
+ tests/examples/Unsafe5.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe5.hs:1:1: Error: Missing NOINLINE pragma\nFound:\n  slaves = x\n    where x = unsafePerformIO Multimap.newIO\nWhy not:\n  {-# NOINLINE slaves #-}\n  slaves = x\n    where x = unsafePerformIO Multimap.newIO\n",[InsertComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 52}, newComment = "{-# NOINLINE slaves #-}"}])]
+ tests/examples/Unsafe6.hs view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO . bar
+ tests/examples/Unsafe6.hs.expected view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO . bar
+ tests/examples/Unsafe6.hs.refact view
@@ -0,0 +1,1 @@+[]
+ tests/examples/Unsafe7.hs view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO . baz $ x
+ tests/examples/Unsafe7.hs.expected view
@@ -0,0 +1,3 @@++{-# NOINLINE slaves #-}+slaves = unsafePerformIO . baz $ x
+ tests/examples/Unsafe7.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe7.hs:1:1: Error: Missing NOINLINE pragma\nFound:\n  slaves = unsafePerformIO . baz $ x\nWhy not:\n  {-# NOINLINE slaves #-}\n  slaves = unsafePerformIO . baz $ x\n",[InsertComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 35}, newComment = "{-# NOINLINE slaves #-}"}])]
+ tests/examples/Unsafe8.hs view
@@ -0,0 +1,1 @@+slaves = unsafePerformIO . baz $ x
+ tests/examples/Unsafe8.hs.expected view
@@ -0,0 +1,3 @@++{-# NOINLINE slaves #-}+slaves = unsafePerformIO . baz $ x
+ tests/examples/Unsafe8.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Unsafe8.hs:1:1: Error: Missing NOINLINE pragma\nFound:\n  slaves = unsafePerformIO . baz $ x\nWhy not:\n  {-# NOINLINE slaves #-}\n  slaves = unsafePerformIO . baz $ x\n",[InsertComment {pos = SrcSpan {startLine = 1, startCol = 1, endLine = 1, endCol = 35}, newComment = "{-# NOINLINE slaves #-}"}])]
+ tests/examples/typetest.hs view
@@ -0,0 +1,36 @@++foo+  | False = baz+  | True  = bux++foo a b = ab+  where+    (x:xs) = if baz+                then qux+                else if qux+                  then faux+                  else vrai++p1+  | g1 = e1+  | g2 = e2+  | otherwise = e3+++foo = qux (\x -> f (b (c x)))++foo = qux (\xs -> e xs)++foo = qux (\x -> x + b)++foo = qux (\x y -> f y x)++foo = qux (\x -> f (b x))++foo = qux (\x -> f x)++foo = qux (\x -> f $ b x)++foo = qux (\x -> (x +))++
+ tests/examples/typetest.hs.expected view
@@ -0,0 +1,35 @@++foo+  | False = baz+  | otherwise  = bux++foo a b = ab+  where+    (x : xs)+      | baz = qux+      | qux = faux+      | otherwise = vrai++p1+  | g1 = e1+  | g2 = e2+  | otherwise = e3+++foo = qux (f . b . c)++foo = qux (e)++foo = qux ((+ b))++foo = qux (flip f)++foo = qux (f . b)++foo = qux (f)++foo = qux (f . b)++foo = qux ((+))++
+ tests/examples/typetest.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/typetest.hs:2:1: Warning: Use otherwise\nFound:\n  foo\n    | False = baz\n    | True = bux\nWhy not:\n  foo\n    | False = baz\n    | otherwise = bux\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 4, startCol = 5, endLine = 4, endCol = 9}, subts = [], orig = "otherwise"}]),("tests/examples/typetest.hs:8:5: Warning: Use guards\nFound:\n  (x : xs) = if baz then qux else if qux then faux else vrai\nWhy not:\n  (x : xs)\n    | baz = qux\n    | qux = faux\n    | otherwise = vrai\n",[Replace {rtype = Bind, pos = SrcSpan {startLine = 8, startCol = 5, endLine = 12, endCol = 28}, subts = [("g1001",SrcSpan {startLine = 8, startCol = 17, endLine = 8, endCol = 20}),("g1002",SrcSpan {startLine = 10, startCol = 25, endLine = 10, endCol = 28}),("e1001",SrcSpan {startLine = 9, startCol = 22, endLine = 9, endCol = 25}),("e1002",SrcSpan {startLine = 11, startCol = 24, endLine = 11, endCol = 28}),("e1003",SrcSpan {startLine = 12, startCol = 24, endLine = 12, endCol = 28})], orig = "(x : xs)\n  | g1001 = e1001\n  | g1002 = e1002\n  | otherwise = e1003"}]),("tests/examples/typetest.hs:20:12: Warning: Avoid lambda\nFound:\n  \\ x -> f (b (c x))\nWhy not:\n  f . b . c\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 20, startCol = 12, endLine = 20, endCol = 29}, subts = [("a",SrcSpan {startLine = 20, startCol = 18, endLine = 20, endCol = 19}),("b",SrcSpan {startLine = 20, startCol = 21, endLine = 20, endCol = 22}),("c",SrcSpan {startLine = 20, startCol = 24, endLine = 20, endCol = 25})], orig = "a . b . c"}]),("tests/examples/typetest.hs:22:12: Error: Avoid lambda\nFound:\n  \\ xs -> e xs\nWhy not:\n  e\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 22, startCol = 12, endLine = 22, endCol = 23}, subts = [("x",SrcSpan {startLine = 22, startCol = 19, endLine = 22, endCol = 20})], orig = "x"}]),("tests/examples/typetest.hs:24:12: Warning: Avoid lambda\nFound:\n  \\ x -> x + b\nWhy not:\n  (+ b)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 24, startCol = 12, endLine = 24, endCol = 23}, subts = [], orig = "(+ b)"}]),("tests/examples/typetest.hs:26:12: Warning: Avoid lambda\nFound:\n  \\ x y -> f y x\nWhy not:\n  flip f\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 26, startCol = 12, endLine = 26, endCol = 25}, subts = [("x",SrcSpan {startLine = 26, startCol = 20, endLine = 26, endCol = 21})], orig = "flip x"}]),("tests/examples/typetest.hs:28:12: Warning: Avoid lambda\nFound:\n  \\ x -> f (b x)\nWhy not:\n  f . b\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 28, startCol = 12, endLine = 28, endCol = 25}, subts = [("a",SrcSpan {startLine = 28, startCol = 18, endLine = 28, endCol = 19}),("b",SrcSpan {startLine = 28, startCol = 21, endLine = 28, endCol = 22})], orig = "a . b"}]),("tests/examples/typetest.hs:30:12: Error: Avoid lambda\nFound:\n  \\ x -> f x\nWhy not:\n  f\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 30, startCol = 12, endLine = 30, endCol = 21}, subts = [("x",SrcSpan {startLine = 30, startCol = 18, endLine = 30, endCol = 19})], orig = "x"}]),("tests/examples/typetest.hs:32:12: Warning: Avoid lambda\nFound:\n  \\ x -> f $ b x\nWhy not:\n  f . b\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 32, startCol = 12, endLine = 32, endCol = 25}, subts = [("a",SrcSpan {startLine = 32, startCol = 18, endLine = 32, endCol = 19}),("b",SrcSpan {startLine = 32, startCol = 22, endLine = 32, endCol = 23})], orig = "a . b"}]),("tests/examples/typetest.hs:34:12: Error: Avoid lambda\nFound:\n  \\ x -> (x +)\nWhy not:\n  (+)\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 34, startCol = 12, endLine = 34, endCol = 23}, subts = [], orig = "(+)"}])]