diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,3 @@
+v0.1
+
+  * Initial Release
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -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.
diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -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.
+
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/apply-refact.cabal b/apply-refact.cabal
new file mode 100644
--- /dev/null
+++ b/apply-refact.cabal
@@ -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
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
--- /dev/null
+++ b/src/Main.hs
@@ -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
+
diff --git a/src/Refact/Apply.hs b/src/Refact/Apply.hs
new file mode 100644
--- /dev/null
+++ b/src/Refact/Apply.hs
@@ -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)
+-}
diff --git a/src/Refact/Fixity.hs b/src/Refact/Fixity.hs
new file mode 100644
--- /dev/null
+++ b/src/Refact/Fixity.hs
@@ -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)
+
diff --git a/src/Refact/Utils.hs b/src/Refact/Utils.hs
new file mode 100644
--- /dev/null
+++ b/src/Refact/Utils.hs
@@ -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
diff --git a/tests/Test.hs b/tests/Test.hs
new file mode 100644
--- /dev/null
+++ b/tests/Test.hs
@@ -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
+
+
+
diff --git a/tests/examples/AndList.hs b/tests/examples/AndList.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/AndList.hs
@@ -0,0 +1,1 @@
+athing = and [a, b]
diff --git a/tests/examples/AndList.hs.expected b/tests/examples/AndList.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/AndList.hs.expected
@@ -0,0 +1,1 @@
+athing = a && b
diff --git a/tests/examples/AndList.hs.refact b/tests/examples/AndList.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/AndList.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Async.hs b/tests/examples/Async.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Async.hs
@@ -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))
+
diff --git a/tests/examples/Async.hs.expected b/tests/examples/Async.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Async.hs.expected
@@ -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))
+
diff --git a/tests/examples/Async.hs.refact b/tests/examples/Async.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Async.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket0.hs b/tests/examples/Bracket0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket0.hs
@@ -0,0 +1,1 @@
+yes = (f x) x
diff --git a/tests/examples/Bracket0.hs.expected b/tests/examples/Bracket0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket0.hs.expected
@@ -0,0 +1,1 @@
+yes = f x x
diff --git a/tests/examples/Bracket0.hs.refact b/tests/examples/Bracket0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket1.hs b/tests/examples/Bracket1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket1.hs
@@ -0,0 +1,1 @@
+no = f (x x)
diff --git a/tests/examples/Bracket1.hs.expected b/tests/examples/Bracket1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket1.hs.expected
@@ -0,0 +1,1 @@
+no = f (x x)
diff --git a/tests/examples/Bracket1.hs.refact b/tests/examples/Bracket1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket1.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket10.hs b/tests/examples/Bracket10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket10.hs
@@ -0,0 +1,1 @@
+yes = [(foo bar)]
diff --git a/tests/examples/Bracket10.hs.expected b/tests/examples/Bracket10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket10.hs.expected
@@ -0,0 +1,1 @@
+yes = [foo bar]
diff --git a/tests/examples/Bracket10.hs.refact b/tests/examples/Bracket10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket10.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket11.hs b/tests/examples/Bracket11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket11.hs
@@ -0,0 +1,1 @@
+yes = foo ((x y), z)
diff --git a/tests/examples/Bracket11.hs.expected b/tests/examples/Bracket11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket11.hs.expected
@@ -0,0 +1,1 @@
+yes = foo (x y, z)
diff --git a/tests/examples/Bracket11.hs.refact b/tests/examples/Bracket11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket11.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket12.hs b/tests/examples/Bracket12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket12.hs
@@ -0,0 +1,1 @@
+yes = C { f = (e h) }
diff --git a/tests/examples/Bracket12.hs.expected b/tests/examples/Bracket12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket12.hs.expected
@@ -0,0 +1,1 @@
+yes = C { f = e h }
diff --git a/tests/examples/Bracket12.hs.refact b/tests/examples/Bracket12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket12.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket13.hs b/tests/examples/Bracket13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket13.hs
@@ -0,0 +1,1 @@
+yes = \ x -> (x && x)
diff --git a/tests/examples/Bracket13.hs.expected b/tests/examples/Bracket13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket13.hs.expected
@@ -0,0 +1,1 @@
+yes x = x && x
diff --git a/tests/examples/Bracket13.hs.refact b/tests/examples/Bracket13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket13.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket14.hs b/tests/examples/Bracket14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket14.hs
@@ -0,0 +1,1 @@
+no = \(x -> y) -> z
diff --git a/tests/examples/Bracket14.hs.expected b/tests/examples/Bracket14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket14.hs.expected
@@ -0,0 +1,1 @@
+no (x -> y) = z
diff --git a/tests/examples/Bracket14.hs.refact b/tests/examples/Bracket14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket14.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket15.hs b/tests/examples/Bracket15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket15.hs
@@ -0,0 +1,1 @@
+yes = (`foo` (bar baz))
diff --git a/tests/examples/Bracket15.hs.expected b/tests/examples/Bracket15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket15.hs.expected
@@ -0,0 +1,1 @@
+yes = (`foo` bar baz)
diff --git a/tests/examples/Bracket15.hs.refact b/tests/examples/Bracket15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket15.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket16.hs b/tests/examples/Bracket16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket16.hs
@@ -0,0 +1,1 @@
+main = do f; (print x)
diff --git a/tests/examples/Bracket16.hs.expected b/tests/examples/Bracket16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket16.hs.expected
@@ -0,0 +1,1 @@
+main = do f; print x
diff --git a/tests/examples/Bracket16.hs.refact b/tests/examples/Bracket16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket16.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket17.hs b/tests/examples/Bracket17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket17.hs
@@ -0,0 +1,1 @@
+foo :: (Int -> Int) -> Int
diff --git a/tests/examples/Bracket17.hs.expected b/tests/examples/Bracket17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket17.hs.expected
@@ -0,0 +1,1 @@
+foo :: (Int -> Int) -> Int
diff --git a/tests/examples/Bracket17.hs.refact b/tests/examples/Bracket17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket17.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket18.hs b/tests/examples/Bracket18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket18.hs
@@ -0,0 +1,1 @@
+foo :: Int -> (Int -> Int)
diff --git a/tests/examples/Bracket18.hs.expected b/tests/examples/Bracket18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket18.hs.expected
@@ -0,0 +1,1 @@
+foo :: Int -> Int -> Int
diff --git a/tests/examples/Bracket18.hs.refact b/tests/examples/Bracket18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket18.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket19.hs b/tests/examples/Bracket19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket19.hs
@@ -0,0 +1,1 @@
+foo :: (Maybe Int) -> a
diff --git a/tests/examples/Bracket19.hs.expected b/tests/examples/Bracket19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket19.hs.expected
@@ -0,0 +1,1 @@
+foo :: Maybe Int -> a
diff --git a/tests/examples/Bracket19.hs.refact b/tests/examples/Bracket19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket19.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket2.hs b/tests/examples/Bracket2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket2.hs
@@ -0,0 +1,1 @@
+yes = (foo)
diff --git a/tests/examples/Bracket2.hs.expected b/tests/examples/Bracket2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket2.hs.expected
@@ -0,0 +1,1 @@
+yes = foo
diff --git a/tests/examples/Bracket2.hs.refact b/tests/examples/Bracket2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket2.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket20.hs b/tests/examples/Bracket20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket20.hs
@@ -0,0 +1,1 @@
+instance Named (DeclHead S)
diff --git a/tests/examples/Bracket20.hs.expected b/tests/examples/Bracket20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket20.hs.expected
@@ -0,0 +1,1 @@
+instance Named (DeclHead S)
diff --git a/tests/examples/Bracket20.hs.refact b/tests/examples/Bracket20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket20.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket21.hs b/tests/examples/Bracket21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket21.hs
@@ -0,0 +1,1 @@
+data Foo = Foo {foo :: (Maybe Foo)}
diff --git a/tests/examples/Bracket21.hs.expected b/tests/examples/Bracket21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket21.hs.expected
@@ -0,0 +1,1 @@
+data Foo = Foo {foo :: Maybe Foo}
diff --git a/tests/examples/Bracket21.hs.refact b/tests/examples/Bracket21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket21.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket22.hs b/tests/examples/Bracket22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket22.hs
@@ -0,0 +1,1 @@
+foo (True) = 1
diff --git a/tests/examples/Bracket22.hs.expected b/tests/examples/Bracket22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket22.hs.expected
@@ -0,0 +1,1 @@
+foo (True) = 1
diff --git a/tests/examples/Bracket22.hs.refact b/tests/examples/Bracket22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket22.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket23.hs b/tests/examples/Bracket23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket23.hs
@@ -0,0 +1,1 @@
+foo ((True)) = 1
diff --git a/tests/examples/Bracket23.hs.expected b/tests/examples/Bracket23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket23.hs.expected
@@ -0,0 +1,1 @@
+foo (True) = 1
diff --git a/tests/examples/Bracket23.hs.refact b/tests/examples/Bracket23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket23.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket24.hs b/tests/examples/Bracket24.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket24.hs
@@ -0,0 +1,1 @@
+no = groupFsts . sortFst $ mr
diff --git a/tests/examples/Bracket24.hs.expected b/tests/examples/Bracket24.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket24.hs.expected
@@ -0,0 +1,1 @@
+no = groupFsts . sortFst $ mr
diff --git a/tests/examples/Bracket24.hs.refact b/tests/examples/Bracket24.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket24.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket25.hs b/tests/examples/Bracket25.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket25.hs
@@ -0,0 +1,1 @@
+yes = split "to" $ names
diff --git a/tests/examples/Bracket25.hs.expected b/tests/examples/Bracket25.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket25.hs.expected
@@ -0,0 +1,1 @@
+yes = split "to" names
diff --git a/tests/examples/Bracket25.hs.refact b/tests/examples/Bracket25.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket25.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket26.hs b/tests/examples/Bracket26.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket26.hs
@@ -0,0 +1,1 @@
+yes = white $ keysymbol
diff --git a/tests/examples/Bracket26.hs.expected b/tests/examples/Bracket26.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket26.hs.expected
@@ -0,0 +1,1 @@
+yes = white keysymbol
diff --git a/tests/examples/Bracket26.hs.refact b/tests/examples/Bracket26.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket26.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket27.hs b/tests/examples/Bracket27.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket27.hs
@@ -0,0 +1,1 @@
+yes = operator foo $ operator
diff --git a/tests/examples/Bracket27.hs.expected b/tests/examples/Bracket27.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket27.hs.expected
@@ -0,0 +1,1 @@
+yes = operator foo operator
diff --git a/tests/examples/Bracket27.hs.refact b/tests/examples/Bracket27.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket27.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket28.hs b/tests/examples/Bracket28.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket28.hs
@@ -0,0 +1,1 @@
+no = operator foo $ operator bar
diff --git a/tests/examples/Bracket28.hs.expected b/tests/examples/Bracket28.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket28.hs.expected
@@ -0,0 +1,1 @@
+no = operator foo $ operator bar
diff --git a/tests/examples/Bracket28.hs.refact b/tests/examples/Bracket28.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket28.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket29.hs b/tests/examples/Bracket29.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket29.hs
@@ -0,0 +1,1 @@
+yes = return $ Record{a=b}
diff --git a/tests/examples/Bracket29.hs.expected b/tests/examples/Bracket29.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket29.hs.expected
@@ -0,0 +1,1 @@
+yes = return Record{a=b}
diff --git a/tests/examples/Bracket29.hs.refact b/tests/examples/Bracket29.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket29.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket3.hs b/tests/examples/Bracket3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket3.hs
@@ -0,0 +1,1 @@
+yes = (foo bar)
diff --git a/tests/examples/Bracket3.hs.expected b/tests/examples/Bracket3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket3.hs.expected
@@ -0,0 +1,1 @@
+yes = foo bar
diff --git a/tests/examples/Bracket3.hs.refact b/tests/examples/Bracket3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket30.hs b/tests/examples/Bracket30.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket30.hs
@@ -0,0 +1,1 @@
+yes = (b $ c d) ++ e
diff --git a/tests/examples/Bracket30.hs.expected b/tests/examples/Bracket30.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket30.hs.expected
@@ -0,0 +1,1 @@
+yes = b (c d) ++ e
diff --git a/tests/examples/Bracket30.hs.refact b/tests/examples/Bracket30.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket30.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Bracket31.hs b/tests/examples/Bracket31.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket31.hs
@@ -0,0 +1,1 @@
+yes = (a b $ c d) ++ e
diff --git a/tests/examples/Bracket31.hs.expected b/tests/examples/Bracket31.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket31.hs.expected
@@ -0,0 +1,1 @@
+yes = a b (c d) ++ e
diff --git a/tests/examples/Bracket31.hs.refact b/tests/examples/Bracket31.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket31.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Bracket32.hs b/tests/examples/Bracket32.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket32.hs
@@ -0,0 +1,1 @@
+no = (f . g $ a) ++ e
diff --git a/tests/examples/Bracket32.hs.expected b/tests/examples/Bracket32.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket32.hs.expected
@@ -0,0 +1,1 @@
+no = (f . g $ a) ++ e
diff --git a/tests/examples/Bracket32.hs.refact b/tests/examples/Bracket32.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket32.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket33.hs b/tests/examples/Bracket33.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket33.hs
@@ -0,0 +1,1 @@
+no = quickCheck ((\h -> cySucc h == succ h) :: Hygiene -> Bool)
diff --git a/tests/examples/Bracket33.hs.expected b/tests/examples/Bracket33.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket33.hs.expected
@@ -0,0 +1,1 @@
+no = quickCheck ((\h -> cySucc h == succ h) :: Hygiene -> Bool)
diff --git a/tests/examples/Bracket33.hs.refact b/tests/examples/Bracket33.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket33.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket34.hs b/tests/examples/Bracket34.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket34.hs
@@ -0,0 +1,1 @@
+foo = (case x of y -> z; q -> w) :: Int
diff --git a/tests/examples/Bracket34.hs.expected b/tests/examples/Bracket34.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket34.hs.expected
@@ -0,0 +1,1 @@
+foo = (case x of y -> z; q -> w) :: Int
diff --git a/tests/examples/Bracket34.hs.refact b/tests/examples/Bracket34.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket34.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket35.hs b/tests/examples/Bracket35.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket35.hs
@@ -0,0 +1,1 @@
+main = do a += b . c; return $ a . b
diff --git a/tests/examples/Bracket35.hs.expected b/tests/examples/Bracket35.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket35.hs.expected
@@ -0,0 +1,1 @@
+main = do a += b . c; return $ a . b
diff --git a/tests/examples/Bracket35.hs.refact b/tests/examples/Bracket35.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket35.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket36.hs b/tests/examples/Bracket36.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket36.hs
@@ -0,0 +1,1 @@
+main = 1; {-# ANN module ("HLint: ignore Use camelCase" :: String) #-}
diff --git a/tests/examples/Bracket36.hs.expected b/tests/examples/Bracket36.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket36.hs.expected
@@ -0,0 +1,1 @@
+main = 1; {-# ANN module ("HLint: ignore Use camelCase" :: String) #-}
diff --git a/tests/examples/Bracket36.hs.refact b/tests/examples/Bracket36.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket36.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Bracket37.hs b/tests/examples/Bracket37.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket37.hs
@@ -0,0 +1,1 @@
+main = 1; {-# ANN module (1 + (2)) #-}
diff --git a/tests/examples/Bracket37.hs.expected b/tests/examples/Bracket37.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket37.hs.expected
@@ -0,0 +1,1 @@
+main = 1; {-# ANN module (1 + 2) #-}
diff --git a/tests/examples/Bracket37.hs.refact b/tests/examples/Bracket37.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket37.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket4.hs b/tests/examples/Bracket4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket4.hs
@@ -0,0 +1,1 @@
+yes = foo (bar)
diff --git a/tests/examples/Bracket4.hs.expected b/tests/examples/Bracket4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket4.hs.expected
@@ -0,0 +1,1 @@
+yes = foo bar
diff --git a/tests/examples/Bracket4.hs.refact b/tests/examples/Bracket4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket5.hs b/tests/examples/Bracket5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket5.hs
@@ -0,0 +1,1 @@
+yes = foo ((x x))
diff --git a/tests/examples/Bracket5.hs.expected b/tests/examples/Bracket5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket5.hs.expected
@@ -0,0 +1,1 @@
+yes = foo (x x)
diff --git a/tests/examples/Bracket5.hs.refact b/tests/examples/Bracket5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket5.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket6.hs b/tests/examples/Bracket6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket6.hs
@@ -0,0 +1,1 @@
+yes = (f x) ||| y
diff --git a/tests/examples/Bracket6.hs.expected b/tests/examples/Bracket6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket6.hs.expected
@@ -0,0 +1,1 @@
+yes = f x ||| y
diff --git a/tests/examples/Bracket6.hs.refact b/tests/examples/Bracket6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket6.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket7.hs b/tests/examples/Bracket7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket7.hs
@@ -0,0 +1,1 @@
+yes = if (f x) then y else z
diff --git a/tests/examples/Bracket7.hs.expected b/tests/examples/Bracket7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket7.hs.expected
@@ -0,0 +1,1 @@
+yes = if f x then y else z
diff --git a/tests/examples/Bracket7.hs.refact b/tests/examples/Bracket7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket7.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket8.hs b/tests/examples/Bracket8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket8.hs
@@ -0,0 +1,1 @@
+yes = if x then (f y) else z
diff --git a/tests/examples/Bracket8.hs.expected b/tests/examples/Bracket8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket8.hs.expected
@@ -0,0 +1,1 @@
+yes = if x then f y else z
diff --git a/tests/examples/Bracket8.hs.refact b/tests/examples/Bracket8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket8.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Bracket9.hs b/tests/examples/Bracket9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket9.hs
@@ -0,0 +1,1 @@
+yes = (a foo) :: Int
diff --git a/tests/examples/Bracket9.hs.expected b/tests/examples/Bracket9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket9.hs.expected
@@ -0,0 +1,1 @@
+yes = a foo :: Int
diff --git a/tests/examples/Bracket9.hs.refact b/tests/examples/Bracket9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Bracket9.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Comment0.hs b/tests/examples/Comment0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment0.hs
@@ -0,0 +1,1 @@
+{- MISSING HASH #-}
diff --git a/tests/examples/Comment0.hs.expected b/tests/examples/Comment0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment0.hs.expected
@@ -0,0 +1,1 @@
+{-# MISSING HASH #-}
diff --git a/tests/examples/Comment0.hs.refact b/tests/examples/Comment0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment0.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Comment1.hs b/tests/examples/Comment1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment1.hs
@@ -0,0 +1,1 @@
+-- {- INLINE X -}
diff --git a/tests/examples/Comment1.hs.expected b/tests/examples/Comment1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment1.hs.expected
@@ -0,0 +1,1 @@
+-- {- INLINE X -}
diff --git a/tests/examples/Comment1.hs.refact b/tests/examples/Comment1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment1.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Comment2.hs b/tests/examples/Comment2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment2.hs
@@ -0,0 +1,1 @@
+{- INLINE Y -}
diff --git a/tests/examples/Comment2.hs.expected b/tests/examples/Comment2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment2.hs.expected
@@ -0,0 +1,1 @@
+{-# INLINE Y #-}
diff --git a/tests/examples/Comment2.hs.refact b/tests/examples/Comment2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment2.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Comment3.hs b/tests/examples/Comment3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment3.hs
@@ -0,0 +1,1 @@
+{- INLINE[~k] f -}
diff --git a/tests/examples/Comment3.hs.expected b/tests/examples/Comment3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment3.hs.expected
@@ -0,0 +1,1 @@
+{-# INLINE[~k] f #-}
diff --git a/tests/examples/Comment3.hs.refact b/tests/examples/Comment3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment3.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Comment4.hs b/tests/examples/Comment4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment4.hs
@@ -0,0 +1,1 @@
+{- NOINLINE Y -}
diff --git a/tests/examples/Comment4.hs.expected b/tests/examples/Comment4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment4.hs.expected
@@ -0,0 +1,1 @@
+{-# NOINLINE Y #-}
diff --git a/tests/examples/Comment4.hs.refact b/tests/examples/Comment4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment4.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Comment5.hs b/tests/examples/Comment5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment5.hs
@@ -0,0 +1,1 @@
+{- UNKNOWN Y -}
diff --git a/tests/examples/Comment5.hs.expected b/tests/examples/Comment5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment5.hs.expected
@@ -0,0 +1,1 @@
+{- UNKNOWN Y -}
diff --git a/tests/examples/Comment5.hs.refact b/tests/examples/Comment5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Comment6.hs b/tests/examples/Comment6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment6.hs
@@ -0,0 +1,1 @@
+-- INLINE X
diff --git a/tests/examples/Comment6.hs.expected b/tests/examples/Comment6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment6.hs.expected
@@ -0,0 +1,1 @@
+-- INLINE X
diff --git a/tests/examples/Comment6.hs.refact b/tests/examples/Comment6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Comment6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default0.hs b/tests/examples/Default0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default0.hs
@@ -0,0 +1,1 @@
+yes = concat . map f
diff --git a/tests/examples/Default0.hs.expected b/tests/examples/Default0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default0.hs.expected
@@ -0,0 +1,1 @@
+yes = concatMap f
diff --git a/tests/examples/Default0.hs.refact b/tests/examples/Default0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default1.hs b/tests/examples/Default1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default1.hs
@@ -0,0 +1,1 @@
+yes = foo . bar . concat . map f . baz . bar
diff --git a/tests/examples/Default1.hs.expected b/tests/examples/Default1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default1.hs.expected
@@ -0,0 +1,1 @@
+yes = foo . bar . concatMap f . baz . bar
diff --git a/tests/examples/Default1.hs.refact b/tests/examples/Default1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default1.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default10.hs b/tests/examples/Default10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default10.hs
@@ -0,0 +1,1 @@
+yes = not (a /= b)
diff --git a/tests/examples/Default10.hs.expected b/tests/examples/Default10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default10.hs.expected
@@ -0,0 +1,1 @@
+yes = a == b
diff --git a/tests/examples/Default10.hs.refact b/tests/examples/Default10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default10.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default100.hs b/tests/examples/Default100.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default100.hs
@@ -0,0 +1,1 @@
+foo = return $! 1
diff --git a/tests/examples/Default100.hs.expected b/tests/examples/Default100.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default100.hs.expected
@@ -0,0 +1,1 @@
+foo = return $! 1
diff --git a/tests/examples/Default100.hs.refact b/tests/examples/Default100.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default100.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default101.hs b/tests/examples/Default101.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default101.hs
@@ -0,0 +1,1 @@
+foo = return $! "test"
diff --git a/tests/examples/Default101.hs.expected b/tests/examples/Default101.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default101.hs.expected
@@ -0,0 +1,1 @@
+foo = return $! "test"
diff --git a/tests/examples/Default101.hs.refact b/tests/examples/Default101.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default101.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default102.hs b/tests/examples/Default102.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default102.hs
@@ -0,0 +1,1 @@
+bar = [x| (x,_) <- pts]
diff --git a/tests/examples/Default102.hs.expected b/tests/examples/Default102.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default102.hs.expected
@@ -0,0 +1,1 @@
+bar = [x| (x,_) <- pts]
diff --git a/tests/examples/Default102.hs.refact b/tests/examples/Default102.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default102.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default103.hs b/tests/examples/Default103.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default103.hs
@@ -0,0 +1,1 @@
+return' x = x `seq` return x
diff --git a/tests/examples/Default103.hs.expected b/tests/examples/Default103.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default103.hs.expected
@@ -0,0 +1,1 @@
+return' x = x `seq` return x
diff --git a/tests/examples/Default103.hs.refact b/tests/examples/Default103.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default103.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default104.hs b/tests/examples/Default104.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default104.hs
@@ -0,0 +1,1 @@
+foo = last (sortBy (compare `on` fst) xs)
diff --git a/tests/examples/Default104.hs.expected b/tests/examples/Default104.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default104.hs.expected
@@ -0,0 +1,1 @@
+foo = maximumBy (compare `on` fst) xs
diff --git a/tests/examples/Default104.hs.refact b/tests/examples/Default104.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default104.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default105.hs b/tests/examples/Default105.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default105.hs
@@ -0,0 +1,1 @@
+g = \ f -> parseFile f >>= (\ cu -> return (f, cu))
diff --git a/tests/examples/Default105.hs.expected b/tests/examples/Default105.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default105.hs.expected
@@ -0,0 +1,1 @@
+g f = parseFile f >>= (\ cu -> return (f, cu))
diff --git a/tests/examples/Default105.hs.refact b/tests/examples/Default105.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default105.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default106.hs b/tests/examples/Default106.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default106.hs
@@ -0,0 +1,1 @@
+foo = bar $ \(x,y) -> x x y
diff --git a/tests/examples/Default106.hs.expected b/tests/examples/Default106.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default106.hs.expected
@@ -0,0 +1,1 @@
+foo = bar $ \(x,y) -> x x y
diff --git a/tests/examples/Default106.hs.refact b/tests/examples/Default106.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default106.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default107.hs b/tests/examples/Default107.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default107.hs
@@ -0,0 +1,1 @@
+foo = qux (\x -> f x >>= g)
diff --git a/tests/examples/Default107.hs.expected b/tests/examples/Default107.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default107.hs.expected
@@ -0,0 +1,1 @@
+foo = qux (f Control.Monad.>=> g)
diff --git a/tests/examples/Default107.hs.refact b/tests/examples/Default107.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default107.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default108.hs b/tests/examples/Default108.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default108.hs
@@ -0,0 +1,1 @@
+foo = qux (\f -> h f >>= g)
diff --git a/tests/examples/Default108.hs.expected b/tests/examples/Default108.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default108.hs.expected
@@ -0,0 +1,1 @@
+foo = qux (h Control.Monad.>=> g)
diff --git a/tests/examples/Default108.hs.refact b/tests/examples/Default108.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default108.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default109.hs b/tests/examples/Default109.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default109.hs
@@ -0,0 +1,1 @@
+foo = qux (\f -> h f >>= f)
diff --git a/tests/examples/Default109.hs.expected b/tests/examples/Default109.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default109.hs.expected
@@ -0,0 +1,1 @@
+foo = qux (\f -> h f >>= f)
diff --git a/tests/examples/Default109.hs.refact b/tests/examples/Default109.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default109.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default11.hs b/tests/examples/Default11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default11.hs
@@ -0,0 +1,1 @@
+yes = qux (if a then 1 else if b then 1 else 2)
diff --git a/tests/examples/Default11.hs.expected b/tests/examples/Default11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default11.hs.expected
@@ -0,0 +1,1 @@
+yes = qux (if a || b then 1 else 2)
diff --git a/tests/examples/Default11.hs.refact b/tests/examples/Default11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default11.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default110.hs b/tests/examples/Default110.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default110.hs
@@ -0,0 +1,1 @@
+foo = bar $ \x -> [x,y]
diff --git a/tests/examples/Default110.hs.expected b/tests/examples/Default110.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default110.hs.expected
@@ -0,0 +1,1 @@
+foo = bar $ \x -> [x,y]
diff --git a/tests/examples/Default110.hs.refact b/tests/examples/Default110.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default110.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default111.hs b/tests/examples/Default111.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default111.hs
@@ -0,0 +1,1 @@
+foo = bar $ \x -> [z,y]
diff --git a/tests/examples/Default111.hs.expected b/tests/examples/Default111.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default111.hs.expected
@@ -0,0 +1,1 @@
+foo = bar $ const [z,y]
diff --git a/tests/examples/Default111.hs.refact b/tests/examples/Default111.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default111.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default112.hs b/tests/examples/Default112.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default112.hs
@@ -0,0 +1,1 @@
+f condition tChar tBool = if condition then _monoField tChar else _monoField tBool
diff --git a/tests/examples/Default112.hs.expected b/tests/examples/Default112.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default112.hs.expected
@@ -0,0 +1,1 @@
+f condition tChar tBool = if condition then _monoField tChar else _monoField tBool
diff --git a/tests/examples/Default112.hs.refact b/tests/examples/Default112.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default112.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default113.hs b/tests/examples/Default113.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default113.hs
@@ -0,0 +1,1 @@
+foo = maybe Bar{..} id
diff --git a/tests/examples/Default113.hs.expected b/tests/examples/Default113.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default113.hs.expected
@@ -0,0 +1,1 @@
+foo = Data.Maybe.fromMaybe Bar{..}
diff --git a/tests/examples/Default113.hs.refact b/tests/examples/Default113.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default113.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default114.hs b/tests/examples/Default114.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default114.hs
@@ -0,0 +1,1 @@
+foo = (\a -> Foo {..}) 1
diff --git a/tests/examples/Default114.hs.expected b/tests/examples/Default114.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default114.hs.expected
@@ -0,0 +1,1 @@
+foo = (\a -> Foo {..}) 1
diff --git a/tests/examples/Default114.hs.refact b/tests/examples/Default114.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default114.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default115.hs b/tests/examples/Default115.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default115.hs
@@ -0,0 +1,1 @@
+foo = zipWith SymInfo [0 ..] (repeat ty)
diff --git a/tests/examples/Default115.hs.expected b/tests/examples/Default115.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default115.hs.expected
@@ -0,0 +1,1 @@
+foo = map (\ x -> SymInfo x ty) [0 ..]
diff --git a/tests/examples/Default115.hs.refact b/tests/examples/Default115.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default115.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default116.hs b/tests/examples/Default116.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default116.hs
@@ -0,0 +1,2 @@
+import Prelude 
+yes = flip mapM
diff --git a/tests/examples/Default116.hs.expected b/tests/examples/Default116.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default116.hs.expected
@@ -0,0 +1,2 @@
+import Prelude
+yes = Control.Monad.forM
diff --git a/tests/examples/Default116.hs.refact b/tests/examples/Default116.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default116.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default117.hs b/tests/examples/Default117.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default117.hs
@@ -0,0 +1,2 @@
+import Control.Monad 
+yes = flip mapM
diff --git a/tests/examples/Default117.hs.expected b/tests/examples/Default117.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default117.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad
+yes = Control.Monad.forM
diff --git a/tests/examples/Default117.hs.refact b/tests/examples/Default117.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default117.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default118.hs b/tests/examples/Default118.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default118.hs
@@ -0,0 +1,2 @@
+import Control.Monad(forM) 
+yes = flip mapM
diff --git a/tests/examples/Default118.hs.expected b/tests/examples/Default118.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default118.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad(forM)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default118.hs.refact b/tests/examples/Default118.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default118.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default119.hs b/tests/examples/Default119.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default119.hs
@@ -0,0 +1,2 @@
+import Control.Monad(forM_) 
+yes = flip mapM
diff --git a/tests/examples/Default119.hs.expected b/tests/examples/Default119.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default119.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad(forM_)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default119.hs.refact b/tests/examples/Default119.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default119.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default12.hs b/tests/examples/Default12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default12.hs
@@ -0,0 +1,1 @@
+no  = if a then 1 else if b then 3 else 2
diff --git a/tests/examples/Default12.hs.expected b/tests/examples/Default12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default12.hs.expected
@@ -0,0 +1,1 @@
+no  = if a then 1 else if b then 3 else 2
diff --git a/tests/examples/Default12.hs.refact b/tests/examples/Default12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default12.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default120.hs b/tests/examples/Default120.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default120.hs
@@ -0,0 +1,2 @@
+import qualified Control.Monad 
+yes = flip mapM
diff --git a/tests/examples/Default120.hs.expected b/tests/examples/Default120.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default120.hs.expected
@@ -0,0 +1,2 @@
+import qualified Control.Monad
+yes = Control.Monad.forM
diff --git a/tests/examples/Default120.hs.refact b/tests/examples/Default120.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default120.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default121.hs b/tests/examples/Default121.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default121.hs
@@ -0,0 +1,2 @@
+import qualified Control.Monad as CM 
+yes = flip mapM
diff --git a/tests/examples/Default121.hs.expected b/tests/examples/Default121.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default121.hs.expected
@@ -0,0 +1,2 @@
+import qualified Control.Monad as CM
+yes = Control.Monad.forM
diff --git a/tests/examples/Default121.hs.refact b/tests/examples/Default121.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default121.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default122.hs b/tests/examples/Default122.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default122.hs
@@ -0,0 +1,2 @@
+import qualified Control.Monad as CM(forM,filterM) 
+yes = flip mapM
diff --git a/tests/examples/Default122.hs.expected b/tests/examples/Default122.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default122.hs.expected
@@ -0,0 +1,2 @@
+import qualified Control.Monad as CM(forM,filterM)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default122.hs.refact b/tests/examples/Default122.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default122.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default123.hs b/tests/examples/Default123.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default123.hs
@@ -0,0 +1,2 @@
+import Control.Monad as CM(forM,filterM) 
+yes = flip mapM
diff --git a/tests/examples/Default123.hs.expected b/tests/examples/Default123.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default123.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad as CM(forM,filterM)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default123.hs.refact b/tests/examples/Default123.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default123.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default124.hs b/tests/examples/Default124.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default124.hs
@@ -0,0 +1,2 @@
+import Control.Monad hiding (forM) 
+yes = flip mapM
diff --git a/tests/examples/Default124.hs.expected b/tests/examples/Default124.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default124.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad hiding (forM)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default124.hs.refact b/tests/examples/Default124.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default124.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default125.hs b/tests/examples/Default125.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default125.hs
@@ -0,0 +1,2 @@
+import Control.Monad hiding (filterM) 
+yes = flip mapM
diff --git a/tests/examples/Default125.hs.expected b/tests/examples/Default125.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default125.hs.expected
@@ -0,0 +1,2 @@
+import Control.Monad hiding (filterM)
+yes = Control.Monad.forM
diff --git a/tests/examples/Default125.hs.refact b/tests/examples/Default125.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default125.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default126.hs b/tests/examples/Default126.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default126.hs
@@ -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"]
diff --git a/tests/examples/Default126.hs.expected b/tests/examples/Default126.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default126.hs.expected
@@ -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"]
diff --git a/tests/examples/Default126.hs.refact b/tests/examples/Default126.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default126.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default127.hs b/tests/examples/Default127.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default127.hs
@@ -0,0 +1,2 @@
+import Text.Blaze.Html5.Attributes as A 
+main = A.id (stringValue id')
diff --git a/tests/examples/Default127.hs.expected b/tests/examples/Default127.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default127.hs.expected
@@ -0,0 +1,2 @@
+import Text.Blaze.Html5.Attributes as A
+main = A.id (stringValue id')
diff --git a/tests/examples/Default127.hs.refact b/tests/examples/Default127.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default127.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default128.hs b/tests/examples/Default128.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default128.hs
@@ -0,0 +1,1 @@
+foo = qux (\x -> f x >>= g)
diff --git a/tests/examples/Default128.hs.expected b/tests/examples/Default128.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default128.hs.expected
@@ -0,0 +1,1 @@
+foo = qux (f Control.Monad.>=> g)
diff --git a/tests/examples/Default128.hs.refact b/tests/examples/Default128.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default128.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default13.hs b/tests/examples/Default13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default13.hs
@@ -0,0 +1,1 @@
+yes = a >>= return . bob
diff --git a/tests/examples/Default13.hs.expected b/tests/examples/Default13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default13.hs.expected
@@ -0,0 +1,1 @@
+yes = Control.Monad.liftM bob a
diff --git a/tests/examples/Default13.hs.refact b/tests/examples/Default13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default13.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default14.hs b/tests/examples/Default14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default14.hs
@@ -0,0 +1,1 @@
+yes = (x !! 0) + (x !! 2)
diff --git a/tests/examples/Default14.hs.expected b/tests/examples/Default14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default14.hs.expected
@@ -0,0 +1,1 @@
+yes = (head x) + (x !! 2)
diff --git a/tests/examples/Default14.hs.refact b/tests/examples/Default14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default14.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default15.hs b/tests/examples/Default15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default15.hs
@@ -0,0 +1,1 @@
+yes = if b < 42 then [a] else []
diff --git a/tests/examples/Default15.hs.expected b/tests/examples/Default15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default15.hs.expected
@@ -0,0 +1,1 @@
+yes = [a | b < 42]
diff --git a/tests/examples/Default15.hs.refact b/tests/examples/Default15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default15.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/Default16.hs b/tests/examples/Default16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default16.hs
@@ -0,0 +1,1 @@
+no  = take n (foo xs) == "hello"
diff --git a/tests/examples/Default16.hs.expected b/tests/examples/Default16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default16.hs.expected
@@ -0,0 +1,1 @@
+no  = take n (foo xs) == "hello"
diff --git a/tests/examples/Default16.hs.refact b/tests/examples/Default16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default16.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default17.hs b/tests/examples/Default17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default17.hs
@@ -0,0 +1,1 @@
+yes = head (reverse xs)
diff --git a/tests/examples/Default17.hs.expected b/tests/examples/Default17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default17.hs.expected
@@ -0,0 +1,1 @@
+yes = last xs
diff --git a/tests/examples/Default17.hs.refact b/tests/examples/Default17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default17.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default18.hs b/tests/examples/Default18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default18.hs
@@ -0,0 +1,1 @@
+yes = reverse xs `isPrefixOf` reverse ys
diff --git a/tests/examples/Default18.hs.expected b/tests/examples/Default18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default18.hs.expected
@@ -0,0 +1,1 @@
+yes = isSuffixOf xs ys
diff --git a/tests/examples/Default18.hs.refact b/tests/examples/Default18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default18.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default19.hs b/tests/examples/Default19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default19.hs
@@ -0,0 +1,1 @@
+no = putStrLn $ show (length xs) ++ "Test"
diff --git a/tests/examples/Default19.hs.expected b/tests/examples/Default19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default19.hs.expected
@@ -0,0 +1,1 @@
+no = putStrLn $ show (length xs) ++ "Test"
diff --git a/tests/examples/Default19.hs.refact b/tests/examples/Default19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default19.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default2.hs b/tests/examples/Default2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default2.hs
@@ -0,0 +1,1 @@
+yes = map f (map g x)
diff --git a/tests/examples/Default2.hs.expected b/tests/examples/Default2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default2.hs.expected
@@ -0,0 +1,1 @@
+yes = map (f . g) x
diff --git a/tests/examples/Default2.hs.refact b/tests/examples/Default2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default2.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default20.hs b/tests/examples/Default20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default20.hs
@@ -0,0 +1,1 @@
+yes = ftable ++ map (\ (c, x) -> (toUpper c, urlEncode x)) ftable
diff --git a/tests/examples/Default20.hs.expected b/tests/examples/Default20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default20.hs.expected
@@ -0,0 +1,1 @@
+yes = ftable ++ map (toUpper Control.Arrow.*** urlEncode) ftable
diff --git a/tests/examples/Default20.hs.refact b/tests/examples/Default20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default20.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default21.hs b/tests/examples/Default21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default21.hs
@@ -0,0 +1,1 @@
+yes = map (\(a,b) -> a) xs
diff --git a/tests/examples/Default21.hs.expected b/tests/examples/Default21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default21.hs.expected
@@ -0,0 +1,1 @@
+yes = map (fst) xs
diff --git a/tests/examples/Default21.hs.refact b/tests/examples/Default21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default21.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default22.hs b/tests/examples/Default22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default22.hs
@@ -0,0 +1,1 @@
+yes = map (\(a,_) -> a) xs
diff --git a/tests/examples/Default22.hs.expected b/tests/examples/Default22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default22.hs.expected
@@ -0,0 +1,1 @@
+yes = map (fst) xs
diff --git a/tests/examples/Default22.hs.refact b/tests/examples/Default22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default22.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default23.hs b/tests/examples/Default23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default23.hs
@@ -0,0 +1,1 @@
+yes = readFile $ args !! 0
diff --git a/tests/examples/Default23.hs.expected b/tests/examples/Default23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default23.hs.expected
@@ -0,0 +1,1 @@
+yes = readFile $ head args
diff --git a/tests/examples/Default23.hs.refact b/tests/examples/Default23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default23.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default24.hs b/tests/examples/Default24.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default24.hs
@@ -0,0 +1,1 @@
+yes = if Debug `elem` opts then ["--debug"] else []
diff --git a/tests/examples/Default24.hs.expected b/tests/examples/Default24.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default24.hs.expected
@@ -0,0 +1,1 @@
+yes = ["--debug" | Debug `elem` opts]
diff --git a/tests/examples/Default24.hs.refact b/tests/examples/Default24.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default24.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/Default25.hs b/tests/examples/Default25.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default25.hs
@@ -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 )
+
diff --git a/tests/examples/Default25.hs.expected b/tests/examples/Default25.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default25.hs.expected
@@ -0,0 +1,2 @@
+yes = qux (if nullPS s || (headPS s /= '\n') then return False else alter_input tailPS >> return True )
+
diff --git a/tests/examples/Default25.hs.refact b/tests/examples/Default25.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default25.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default26.hs b/tests/examples/Default26.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default26.hs
@@ -0,0 +1,2 @@
+yes = if foo then do stuff; moreStuff; lastOfTheStuff else return () 
+   
diff --git a/tests/examples/Default26.hs.expected b/tests/examples/Default26.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default26.hs.expected
@@ -0,0 +1,2 @@
+yes = Control.Monad.when foo $ do stuff; moreStuff; lastOfTheStuff
+
diff --git a/tests/examples/Default26.hs.refact b/tests/examples/Default26.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default26.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default27.hs b/tests/examples/Default27.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default27.hs
@@ -0,0 +1,1 @@
+yes = if foo then stuff else return ()
diff --git a/tests/examples/Default27.hs.expected b/tests/examples/Default27.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default27.hs.expected
@@ -0,0 +1,1 @@
+yes = Control.Monad.when foo stuff
diff --git a/tests/examples/Default27.hs.refact b/tests/examples/Default27.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default27.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default28.hs b/tests/examples/Default28.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default28.hs
@@ -0,0 +1,1 @@
+yes = foo $ \(a, b) -> (a, y + b)
diff --git a/tests/examples/Default28.hs.expected b/tests/examples/Default28.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default28.hs.expected
@@ -0,0 +1,1 @@
+yes = foo $ Control.Arrow.second ((+) y)
diff --git a/tests/examples/Default28.hs.refact b/tests/examples/Default28.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default28.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default29.hs b/tests/examples/Default29.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default29.hs
@@ -0,0 +1,1 @@
+no  = foo $ \(a, b) -> (a, a + b)
diff --git a/tests/examples/Default29.hs.expected b/tests/examples/Default29.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default29.hs.expected
@@ -0,0 +1,1 @@
+no  = foo $ \(a, b) -> (a, a + b)
diff --git a/tests/examples/Default29.hs.refact b/tests/examples/Default29.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default29.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default3.hs b/tests/examples/Default3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default3.hs
@@ -0,0 +1,1 @@
+yes = concat.map (\x->if x==e then l' else [x])
diff --git a/tests/examples/Default3.hs.expected b/tests/examples/Default3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default3.hs.expected
@@ -0,0 +1,1 @@
+yes = concatMap (\x->if x==e then l' else [x])
diff --git a/tests/examples/Default3.hs.refact b/tests/examples/Default3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default30.hs b/tests/examples/Default30.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default30.hs
@@ -0,0 +1,1 @@
+yes = map (uncurry (+)) $ zip [1 .. 5] [6 .. 10]
diff --git a/tests/examples/Default30.hs.expected b/tests/examples/Default30.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default30.hs.expected
@@ -0,0 +1,1 @@
+yes = zipWith (+) [1 .. 5] [6 .. 10]
diff --git a/tests/examples/Default30.hs.refact b/tests/examples/Default30.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default30.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default31.hs b/tests/examples/Default31.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default31.hs
@@ -0,0 +1,1 @@
+no = do iter <- textBufferGetTextIter tb ; textBufferSelectRange tb iter iter
diff --git a/tests/examples/Default31.hs.expected b/tests/examples/Default31.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default31.hs.expected
@@ -0,0 +1,1 @@
+no = do iter <- textBufferGetTextIter tb ; textBufferSelectRange tb iter iter
diff --git a/tests/examples/Default31.hs.refact b/tests/examples/Default31.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default31.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default32.hs b/tests/examples/Default32.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default32.hs
@@ -0,0 +1,1 @@
+no = flip f x $ \y -> y*y+y
diff --git a/tests/examples/Default32.hs.expected b/tests/examples/Default32.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default32.hs.expected
@@ -0,0 +1,1 @@
+no = flip f x $ \y -> y*y+y
diff --git a/tests/examples/Default32.hs.refact b/tests/examples/Default32.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default32.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default33.hs b/tests/examples/Default33.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default33.hs
@@ -0,0 +1,1 @@
+no = \x -> f x (g x)
diff --git a/tests/examples/Default33.hs.expected b/tests/examples/Default33.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default33.hs.expected
@@ -0,0 +1,1 @@
+no x = f x (g x)
diff --git a/tests/examples/Default33.hs.refact b/tests/examples/Default33.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default33.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default34.hs b/tests/examples/Default34.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default34.hs
@@ -0,0 +1,1 @@
+no = foo (\ v -> f v . g)
diff --git a/tests/examples/Default34.hs.expected b/tests/examples/Default34.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default34.hs.expected
@@ -0,0 +1,1 @@
+no = foo (\ v -> f v . g)
diff --git a/tests/examples/Default34.hs.refact b/tests/examples/Default34.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default34.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default35.hs b/tests/examples/Default35.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default35.hs
@@ -0,0 +1,1 @@
+yes = concat . intersperse " "
diff --git a/tests/examples/Default35.hs.expected b/tests/examples/Default35.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default35.hs.expected
@@ -0,0 +1,1 @@
+yes = unwords
diff --git a/tests/examples/Default35.hs.refact b/tests/examples/Default35.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default35.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default36.hs b/tests/examples/Default36.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default36.hs
@@ -0,0 +1,1 @@
+yes = Prelude.concat $ intersperse " " xs
diff --git a/tests/examples/Default36.hs.expected b/tests/examples/Default36.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default36.hs.expected
@@ -0,0 +1,1 @@
+yes = unwords xs
diff --git a/tests/examples/Default36.hs.refact b/tests/examples/Default36.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default36.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default37.hs b/tests/examples/Default37.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default37.hs
@@ -0,0 +1,1 @@
+yes = concat $ Data.List.intersperse " " xs
diff --git a/tests/examples/Default37.hs.expected b/tests/examples/Default37.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default37.hs.expected
@@ -0,0 +1,1 @@
+yes = unwords xs
diff --git a/tests/examples/Default37.hs.refact b/tests/examples/Default37.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default37.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default38.hs b/tests/examples/Default38.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default38.hs
@@ -0,0 +1,1 @@
+yes = if a then True else False
diff --git a/tests/examples/Default38.hs.expected b/tests/examples/Default38.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default38.hs.expected
@@ -0,0 +1,1 @@
+yes = a
diff --git a/tests/examples/Default38.hs.refact b/tests/examples/Default38.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default38.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default39.hs b/tests/examples/Default39.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default39.hs
@@ -0,0 +1,1 @@
+yes = if x then true else False
diff --git a/tests/examples/Default39.hs.expected b/tests/examples/Default39.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default39.hs.expected
@@ -0,0 +1,1 @@
+yes = x && true
diff --git a/tests/examples/Default39.hs.refact b/tests/examples/Default39.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default39.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default4.hs b/tests/examples/Default4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default4.hs
@@ -0,0 +1,1 @@
+yes = f x where f x = concat . map head
diff --git a/tests/examples/Default4.hs.expected b/tests/examples/Default4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default4.hs.expected
@@ -0,0 +1,1 @@
+yes = f x where f x = concatMap head
diff --git a/tests/examples/Default4.hs.refact b/tests/examples/Default4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default40.hs b/tests/examples/Default40.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default40.hs
@@ -0,0 +1,1 @@
+yes = elem x y
diff --git a/tests/examples/Default40.hs.expected b/tests/examples/Default40.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default40.hs.expected
@@ -0,0 +1,1 @@
+yes = x `elem` y
diff --git a/tests/examples/Default40.hs.refact b/tests/examples/Default40.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default40.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default41.hs b/tests/examples/Default41.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default41.hs
@@ -0,0 +1,1 @@
+yes = foo (elem x y)
diff --git a/tests/examples/Default41.hs.expected b/tests/examples/Default41.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default41.hs.expected
@@ -0,0 +1,1 @@
+yes = foo (x `elem` y)
diff --git a/tests/examples/Default41.hs.refact b/tests/examples/Default41.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default41.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default42.hs b/tests/examples/Default42.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default42.hs
@@ -0,0 +1,1 @@
+no  = x `elem` y
diff --git a/tests/examples/Default42.hs.expected b/tests/examples/Default42.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default42.hs.expected
@@ -0,0 +1,1 @@
+no  = x `elem` y
diff --git a/tests/examples/Default42.hs.refact b/tests/examples/Default42.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default42.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default43.hs b/tests/examples/Default43.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default43.hs
@@ -0,0 +1,1 @@
+no  = elem 1 [] : []
diff --git a/tests/examples/Default43.hs.expected b/tests/examples/Default43.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default43.hs.expected
@@ -0,0 +1,1 @@
+no  = [elem 1 []]
diff --git a/tests/examples/Default43.hs.refact b/tests/examples/Default43.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default43.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/Default44.hs b/tests/examples/Default44.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default44.hs
@@ -0,0 +1,1 @@
+test a = foo (\x -> True)
diff --git a/tests/examples/Default44.hs.expected b/tests/examples/Default44.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default44.hs.expected
@@ -0,0 +1,1 @@
+test a = foo (const True)
diff --git a/tests/examples/Default44.hs.refact b/tests/examples/Default44.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default44.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default45.hs b/tests/examples/Default45.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default45.hs
@@ -0,0 +1,1 @@
+h a = flip f x (y z)
diff --git a/tests/examples/Default45.hs.expected b/tests/examples/Default45.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default45.hs.expected
@@ -0,0 +1,1 @@
+h a = f (y z) x
diff --git a/tests/examples/Default45.hs.refact b/tests/examples/Default45.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default45.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default46.hs b/tests/examples/Default46.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default46.hs
@@ -0,0 +1,1 @@
+h a = flip f x $ y z
diff --git a/tests/examples/Default46.hs.expected b/tests/examples/Default46.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default46.hs.expected
@@ -0,0 +1,1 @@
+h a = flip f x $ y z
diff --git a/tests/examples/Default46.hs.refact b/tests/examples/Default46.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default46.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default47.hs b/tests/examples/Default47.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default47.hs
@@ -0,0 +1,1 @@
+yes x = case x of {True -> a ; False -> b}
diff --git a/tests/examples/Default47.hs.expected b/tests/examples/Default47.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default47.hs.expected
@@ -0,0 +1,1 @@
+yes x = if x then a else b
diff --git a/tests/examples/Default47.hs.refact b/tests/examples/Default47.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default47.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default48.hs b/tests/examples/Default48.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default48.hs
@@ -0,0 +1,1 @@
+yes x = case x of {False -> a ; _ -> b}
diff --git a/tests/examples/Default48.hs.expected b/tests/examples/Default48.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default48.hs.expected
@@ -0,0 +1,1 @@
+yes x = if x then b else a
diff --git a/tests/examples/Default48.hs.refact b/tests/examples/Default48.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default48.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default49.hs b/tests/examples/Default49.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default49.hs
@@ -0,0 +1,1 @@
+no = const . ok . toResponse $ "saved"
diff --git a/tests/examples/Default49.hs.expected b/tests/examples/Default49.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default49.hs.expected
@@ -0,0 +1,1 @@
+no = const . ok . toResponse $ "saved"
diff --git a/tests/examples/Default49.hs.refact b/tests/examples/Default49.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default49.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default5.hs b/tests/examples/Default5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default5.hs
@@ -0,0 +1,1 @@
+yes = concat . map f . g
diff --git a/tests/examples/Default5.hs.expected b/tests/examples/Default5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default5.hs.expected
@@ -0,0 +1,1 @@
+yes = concatMap f . g
diff --git a/tests/examples/Default5.hs.refact b/tests/examples/Default5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default5.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default50.hs b/tests/examples/Default50.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default50.hs
@@ -0,0 +1,1 @@
+yes = case x z of Nothing -> y z; Just pat -> pat
diff --git a/tests/examples/Default50.hs.expected b/tests/examples/Default50.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default50.hs.expected
@@ -0,0 +1,1 @@
+yes = fromMaybe (y z) (x z)
diff --git a/tests/examples/Default50.hs.refact b/tests/examples/Default50.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default50.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default51.hs b/tests/examples/Default51.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default51.hs
@@ -0,0 +1,1 @@
+yes = if p then s else return ()
diff --git a/tests/examples/Default51.hs.expected b/tests/examples/Default51.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default51.hs.expected
@@ -0,0 +1,1 @@
+yes = Control.Monad.when p s
diff --git a/tests/examples/Default51.hs.refact b/tests/examples/Default51.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default51.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default52.hs b/tests/examples/Default52.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default52.hs
@@ -0,0 +1,1 @@
+error = a $$$$ b $$$$ c ==> a . b $$$$$ c
diff --git a/tests/examples/Default52.hs.expected b/tests/examples/Default52.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default52.hs.expected
@@ -0,0 +1,1 @@
+error = a $$$$ b $$$$ c ==> a . b $$$$$ c
diff --git a/tests/examples/Default52.hs.refact b/tests/examples/Default52.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default52.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default53.hs b/tests/examples/Default53.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default53.hs
@@ -0,0 +1,1 @@
+yes = when (not . null $ asdf)
diff --git a/tests/examples/Default53.hs.expected b/tests/examples/Default53.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default53.hs.expected
@@ -0,0 +1,1 @@
+yes = unless (null asdf)
diff --git a/tests/examples/Default53.hs.refact b/tests/examples/Default53.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default53.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default54.hs b/tests/examples/Default54.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default54.hs
@@ -0,0 +1,1 @@
+yes = id 1
diff --git a/tests/examples/Default54.hs.expected b/tests/examples/Default54.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default54.hs.expected
@@ -0,0 +1,1 @@
+yes = 1
diff --git a/tests/examples/Default54.hs.refact b/tests/examples/Default54.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default54.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default55.hs b/tests/examples/Default55.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default55.hs
@@ -0,0 +1,1 @@
+yes = case concat (map f x) of [] -> []
diff --git a/tests/examples/Default55.hs.expected b/tests/examples/Default55.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default55.hs.expected
@@ -0,0 +1,1 @@
+yes = case concatMap f x of [] -> []
diff --git a/tests/examples/Default55.hs.refact b/tests/examples/Default55.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default55.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default56.hs b/tests/examples/Default56.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default56.hs
@@ -0,0 +1,1 @@
+yes = [v | v <- xs]
diff --git a/tests/examples/Default56.hs.expected b/tests/examples/Default56.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default56.hs.expected
@@ -0,0 +1,1 @@
+yes = xs
diff --git a/tests/examples/Default56.hs.refact b/tests/examples/Default56.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default56.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default57.hs b/tests/examples/Default57.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default57.hs
@@ -0,0 +1,1 @@
+no  = [Left x | Left x <- xs]
diff --git a/tests/examples/Default57.hs.expected b/tests/examples/Default57.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default57.hs.expected
@@ -0,0 +1,1 @@
+no  = [Left x | Left x <- xs]
diff --git a/tests/examples/Default57.hs.refact b/tests/examples/Default57.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default57.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default58.hs b/tests/examples/Default58.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default58.hs
@@ -0,0 +1,1 @@
+when p s = if p then s else return ()
diff --git a/tests/examples/Default58.hs.expected b/tests/examples/Default58.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default58.hs.expected
@@ -0,0 +1,1 @@
+when p s = if p then s else return ()
diff --git a/tests/examples/Default58.hs.refact b/tests/examples/Default58.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default58.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default59.hs b/tests/examples/Default59.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default59.hs
@@ -0,0 +1,1 @@
+no = x ^^ 18.5
diff --git a/tests/examples/Default59.hs.expected b/tests/examples/Default59.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default59.hs.expected
@@ -0,0 +1,1 @@
+no = x ^^ 18.5
diff --git a/tests/examples/Default59.hs.refact b/tests/examples/Default59.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default59.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default6.hs b/tests/examples/Default6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default6.hs
@@ -0,0 +1,1 @@
+yes = concat $ map f x
diff --git a/tests/examples/Default6.hs.expected b/tests/examples/Default6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default6.hs.expected
@@ -0,0 +1,1 @@
+yes = concatMap f x
diff --git a/tests/examples/Default6.hs.refact b/tests/examples/Default6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default6.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default60.hs b/tests/examples/Default60.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default60.hs
@@ -0,0 +1,1 @@
+instance Arrow (->) where first f = f *** id
diff --git a/tests/examples/Default60.hs.expected b/tests/examples/Default60.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default60.hs.expected
@@ -0,0 +1,1 @@
+instance Arrow (->) where first f = f *** id
diff --git a/tests/examples/Default60.hs.refact b/tests/examples/Default60.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default60.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default61.hs b/tests/examples/Default61.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default61.hs
@@ -0,0 +1,1 @@
+yes = fromInteger 12
diff --git a/tests/examples/Default61.hs.expected b/tests/examples/Default61.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default61.hs.expected
@@ -0,0 +1,1 @@
+yes = 12
diff --git a/tests/examples/Default61.hs.refact b/tests/examples/Default61.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default61.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default62.hs b/tests/examples/Default62.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default62.hs
@@ -0,0 +1,1 @@
+import Prelude hiding (catch); no = catch
diff --git a/tests/examples/Default62.hs.expected b/tests/examples/Default62.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default62.hs.expected
@@ -0,0 +1,1 @@
+import Prelude hiding (catch); no = catch
diff --git a/tests/examples/Default62.hs.refact b/tests/examples/Default62.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default62.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default63.hs b/tests/examples/Default63.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default63.hs
@@ -0,0 +1,1 @@
+import Control.Exception as E; no = E.catch
diff --git a/tests/examples/Default63.hs.expected b/tests/examples/Default63.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default63.hs.expected
@@ -0,0 +1,1 @@
+import Control.Exception as E; no = E.catch
diff --git a/tests/examples/Default63.hs.refact b/tests/examples/Default63.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default63.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default64.hs b/tests/examples/Default64.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default64.hs
@@ -0,0 +1,1 @@
+main = do f; putStrLn $ show x
diff --git a/tests/examples/Default64.hs.expected b/tests/examples/Default64.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default64.hs.expected
@@ -0,0 +1,1 @@
+main = do f; print x
diff --git a/tests/examples/Default64.hs.refact b/tests/examples/Default64.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default64.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default65.hs b/tests/examples/Default65.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default65.hs
@@ -0,0 +1,1 @@
+main = map (writer,) $ map arcObj $ filter (rdfPredEq (Res dctreferences)) ts
diff --git a/tests/examples/Default65.hs.expected b/tests/examples/Default65.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default65.hs.expected
@@ -0,0 +1,1 @@
+main = map ((writer,) . arcObj) (filter (rdfPredEq (Res dctreferences)) ts)
diff --git a/tests/examples/Default65.hs.refact b/tests/examples/Default65.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default65.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default66.hs b/tests/examples/Default66.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default66.hs
@@ -0,0 +1,1 @@
+h x y = return $! (x, y)
diff --git a/tests/examples/Default66.hs.expected b/tests/examples/Default66.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default66.hs.expected
@@ -0,0 +1,1 @@
+h x y = return (x, y)
diff --git a/tests/examples/Default66.hs.refact b/tests/examples/Default66.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default66.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default67.hs b/tests/examples/Default67.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default67.hs
@@ -0,0 +1,1 @@
+h x y = return $! x
diff --git a/tests/examples/Default67.hs.expected b/tests/examples/Default67.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default67.hs.expected
@@ -0,0 +1,1 @@
+h x y = return $! x
diff --git a/tests/examples/Default67.hs.refact b/tests/examples/Default67.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default67.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default68.hs b/tests/examples/Default68.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default68.hs
@@ -0,0 +1,1 @@
+getInt = do { x <- readIO "0"; return $! (x :: Int) }
diff --git a/tests/examples/Default68.hs.expected b/tests/examples/Default68.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default68.hs.expected
@@ -0,0 +1,1 @@
+getInt = do { x <- readIO "0"; return $! (x :: Int) }
diff --git a/tests/examples/Default68.hs.refact b/tests/examples/Default68.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default68.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default69.hs b/tests/examples/Default69.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default69.hs
@@ -0,0 +1,1 @@
+foo = evaluate [12]
diff --git a/tests/examples/Default69.hs.expected b/tests/examples/Default69.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default69.hs.expected
@@ -0,0 +1,1 @@
+foo = return [12]
diff --git a/tests/examples/Default69.hs.refact b/tests/examples/Default69.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default69.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default7.hs b/tests/examples/Default7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default7.hs
@@ -0,0 +1,1 @@
+yes = "test" ++ concatMap (' ':) ["of","this"]
diff --git a/tests/examples/Default7.hs.expected b/tests/examples/Default7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default7.hs.expected
@@ -0,0 +1,1 @@
+yes = unwords ("test" : ["of","this"])
diff --git a/tests/examples/Default7.hs.refact b/tests/examples/Default7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default7.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default70.hs b/tests/examples/Default70.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default70.hs
@@ -0,0 +1,1 @@
+test = qux (\ a -> f a >>= \ b -> return (a, b))
diff --git a/tests/examples/Default70.hs.expected b/tests/examples/Default70.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default70.hs.expected
@@ -0,0 +1,1 @@
+test = qux (\ a -> f a >>= \ b -> return (a, b))
diff --git a/tests/examples/Default70.hs.refact b/tests/examples/Default70.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default70.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default71.hs b/tests/examples/Default71.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default71.hs
@@ -0,0 +1,1 @@
+fooer input = catMaybes . map Just $ input
diff --git a/tests/examples/Default71.hs.expected b/tests/examples/Default71.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default71.hs.expected
@@ -0,0 +1,1 @@
+fooer input = mapMaybe Just $ input
diff --git a/tests/examples/Default71.hs.refact b/tests/examples/Default71.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default71.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default72.hs b/tests/examples/Default72.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default72.hs
@@ -0,0 +1,1 @@
+yes = mapMaybe id
diff --git a/tests/examples/Default72.hs.expected b/tests/examples/Default72.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default72.hs.expected
@@ -0,0 +1,1 @@
+yes = catMaybes
diff --git a/tests/examples/Default72.hs.refact b/tests/examples/Default72.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default72.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default73.hs b/tests/examples/Default73.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default73.hs
@@ -0,0 +1,1 @@
+main = print $ map (\_->5) [2,3,5]
diff --git a/tests/examples/Default73.hs.expected b/tests/examples/Default73.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default73.hs.expected
@@ -0,0 +1,1 @@
+main = print $ map (const 5) [2,3,5]
diff --git a/tests/examples/Default73.hs.refact b/tests/examples/Default73.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default73.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default74.hs b/tests/examples/Default74.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default74.hs
@@ -0,0 +1,1 @@
+main = head $ drop n x
diff --git a/tests/examples/Default74.hs.expected b/tests/examples/Default74.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default74.hs.expected
@@ -0,0 +1,1 @@
+main = head $ drop n x
diff --git a/tests/examples/Default74.hs.refact b/tests/examples/Default74.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default74.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default75.hs b/tests/examples/Default75.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default75.hs
@@ -0,0 +1,1 @@
+main = head $ drop (-3) x
diff --git a/tests/examples/Default75.hs.expected b/tests/examples/Default75.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default75.hs.expected
@@ -0,0 +1,1 @@
+main = head $ x
diff --git a/tests/examples/Default75.hs.refact b/tests/examples/Default75.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default75.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default76.hs b/tests/examples/Default76.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default76.hs
@@ -0,0 +1,1 @@
+main = head $ drop 2 x
diff --git a/tests/examples/Default76.hs.expected b/tests/examples/Default76.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default76.hs.expected
@@ -0,0 +1,1 @@
+main = x !! 2
diff --git a/tests/examples/Default76.hs.refact b/tests/examples/Default76.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default76.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default77.hs b/tests/examples/Default77.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default77.hs
@@ -0,0 +1,1 @@
+main = drop 0 x
diff --git a/tests/examples/Default77.hs.expected b/tests/examples/Default77.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default77.hs.expected
@@ -0,0 +1,1 @@
+main = x
diff --git a/tests/examples/Default77.hs.refact b/tests/examples/Default77.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default77.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default78.hs b/tests/examples/Default78.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default78.hs
@@ -0,0 +1,1 @@
+main = take 0 x
diff --git a/tests/examples/Default78.hs.expected b/tests/examples/Default78.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default78.hs.expected
@@ -0,0 +1,1 @@
+main = []
diff --git a/tests/examples/Default78.hs.refact b/tests/examples/Default78.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default78.hs.refact
@@ -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 = "[]"}])]
diff --git a/tests/examples/Default79.hs b/tests/examples/Default79.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default79.hs
@@ -0,0 +1,1 @@
+main = take (-5) x
diff --git a/tests/examples/Default79.hs.expected b/tests/examples/Default79.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default79.hs.expected
@@ -0,0 +1,1 @@
+main = []
diff --git a/tests/examples/Default79.hs.refact b/tests/examples/Default79.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default79.hs.refact
@@ -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 = "[]"}])]
diff --git a/tests/examples/Default8.hs b/tests/examples/Default8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default8.hs
@@ -0,0 +1,1 @@
+yes = if f a then True else b
diff --git a/tests/examples/Default8.hs.expected b/tests/examples/Default8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default8.hs.expected
@@ -0,0 +1,1 @@
+yes = f a || b
diff --git a/tests/examples/Default8.hs.refact b/tests/examples/Default8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default8.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default80.hs b/tests/examples/Default80.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default80.hs
@@ -0,0 +1,1 @@
+main = take (-y) x
diff --git a/tests/examples/Default80.hs.expected b/tests/examples/Default80.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default80.hs.expected
@@ -0,0 +1,1 @@
+main = take (-y) x
diff --git a/tests/examples/Default80.hs.refact b/tests/examples/Default80.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default80.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default81.hs b/tests/examples/Default81.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default81.hs
@@ -0,0 +1,1 @@
+main = take 4 x
diff --git a/tests/examples/Default81.hs.expected b/tests/examples/Default81.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default81.hs.expected
@@ -0,0 +1,1 @@
+main = take 4 x
diff --git a/tests/examples/Default81.hs.refact b/tests/examples/Default81.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default81.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default82.hs b/tests/examples/Default82.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default82.hs
@@ -0,0 +1,1 @@
+main = let (first, rest) = (takeWhile p l, dropWhile p l) in rest
diff --git a/tests/examples/Default82.hs.expected b/tests/examples/Default82.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default82.hs.expected
@@ -0,0 +1,1 @@
+main = let (first, rest) = span p l in rest
diff --git a/tests/examples/Default82.hs.refact b/tests/examples/Default82.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default82.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default83.hs b/tests/examples/Default83.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default83.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-}
+main = map $ \ d -> ([| $d |], [| $d |])
diff --git a/tests/examples/Default83.hs.expected b/tests/examples/Default83.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default83.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-}
+main = map $ \ d -> ([| $d |], [| $d |])
diff --git a/tests/examples/Default83.hs.refact b/tests/examples/Default83.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default83.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default84.hs b/tests/examples/Default84.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default84.hs
@@ -0,0 +1,1 @@
+pairs (x:xs) = map (\y -> (x,y)) xs ++ pairs xs
diff --git a/tests/examples/Default84.hs.expected b/tests/examples/Default84.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default84.hs.expected
@@ -0,0 +1,1 @@
+pairs (x:xs) = map (\y -> (x,y)) xs ++ pairs xs
diff --git a/tests/examples/Default84.hs.refact b/tests/examples/Default84.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default84.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default85.hs b/tests/examples/Default85.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default85.hs
@@ -0,0 +1,1 @@
+{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
diff --git a/tests/examples/Default85.hs.expected b/tests/examples/Default85.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default85.hs.expected
@@ -0,0 +1,1 @@
+{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
diff --git a/tests/examples/Default85.hs.refact b/tests/examples/Default85.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default85.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default86.hs b/tests/examples/Default86.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default86.hs
@@ -0,0 +1,1 @@
+yes = fmap lines $ abc 123
diff --git a/tests/examples/Default86.hs.expected b/tests/examples/Default86.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default86.hs.expected
@@ -0,0 +1,1 @@
+yes = lines Control.Applicative.<$> abc 123
diff --git a/tests/examples/Default86.hs.refact b/tests/examples/Default86.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default86.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default87.hs b/tests/examples/Default87.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default87.hs
@@ -0,0 +1,1 @@
+no = fmap lines $ abc $ def 123
diff --git a/tests/examples/Default87.hs.expected b/tests/examples/Default87.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default87.hs.expected
@@ -0,0 +1,1 @@
+no = fmap lines $ abc $ def 123
diff --git a/tests/examples/Default87.hs.refact b/tests/examples/Default87.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default87.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default88.hs b/tests/examples/Default88.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default88.hs
@@ -0,0 +1,1 @@
+test = foo . not . not
diff --git a/tests/examples/Default88.hs.expected b/tests/examples/Default88.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default88.hs.expected
@@ -0,0 +1,1 @@
+test = foo . id
diff --git a/tests/examples/Default88.hs.refact b/tests/examples/Default88.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default88.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default89.hs b/tests/examples/Default89.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default89.hs
@@ -0,0 +1,1 @@
+test = map (not . not) xs
diff --git a/tests/examples/Default89.hs.expected b/tests/examples/Default89.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default89.hs.expected
@@ -0,0 +1,1 @@
+test = map (id) xs
diff --git a/tests/examples/Default89.hs.refact b/tests/examples/Default89.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default89.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default9.hs b/tests/examples/Default9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default9.hs
@@ -0,0 +1,1 @@
+yes = not (a == b)
diff --git a/tests/examples/Default9.hs.expected b/tests/examples/Default9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default9.hs.expected
@@ -0,0 +1,1 @@
+yes = a /= b
diff --git a/tests/examples/Default9.hs.refact b/tests/examples/Default9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default9.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default90.hs b/tests/examples/Default90.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default90.hs
@@ -0,0 +1,1 @@
+used = not . not . any (`notElem` special) . fst . derives
diff --git a/tests/examples/Default90.hs.expected b/tests/examples/Default90.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default90.hs.expected
@@ -0,0 +1,1 @@
+used = any (`notElem` special) . fst . derives
diff --git a/tests/examples/Default90.hs.refact b/tests/examples/Default90.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default90.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default91.hs b/tests/examples/Default91.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default91.hs
@@ -0,0 +1,1 @@
+test = foo . id . map
diff --git a/tests/examples/Default91.hs.expected b/tests/examples/Default91.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default91.hs.expected
@@ -0,0 +1,1 @@
+test = foo . map
diff --git a/tests/examples/Default91.hs.refact b/tests/examples/Default91.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default91.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Default92.hs b/tests/examples/Default92.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default92.hs
@@ -0,0 +1,1 @@
+test = food id xs
diff --git a/tests/examples/Default92.hs.expected b/tests/examples/Default92.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default92.hs.expected
@@ -0,0 +1,1 @@
+test = food id xs
diff --git a/tests/examples/Default92.hs.refact b/tests/examples/Default92.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default92.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default93.hs b/tests/examples/Default93.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default93.hs
@@ -0,0 +1,1 @@
+yes = baz baz >> return ()
diff --git a/tests/examples/Default93.hs.expected b/tests/examples/Default93.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default93.hs.expected
@@ -0,0 +1,1 @@
+yes = Control.Monad.void (baz baz)
diff --git a/tests/examples/Default93.hs.refact b/tests/examples/Default93.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default93.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default94.hs b/tests/examples/Default94.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default94.hs
@@ -0,0 +1,1 @@
+no = foo >>= bar >>= something >>= elsee >> return ()
diff --git a/tests/examples/Default94.hs.expected b/tests/examples/Default94.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default94.hs.expected
@@ -0,0 +1,1 @@
+no = foo >>= bar >>= something >>= elsee >> return ()
diff --git a/tests/examples/Default94.hs.refact b/tests/examples/Default94.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default94.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default95.hs b/tests/examples/Default95.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default95.hs
@@ -0,0 +1,1 @@
+no = f (#) x
diff --git a/tests/examples/Default95.hs.expected b/tests/examples/Default95.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default95.hs.expected
@@ -0,0 +1,1 @@
+no = f (#) x
diff --git a/tests/examples/Default95.hs.refact b/tests/examples/Default95.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default95.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default96.hs b/tests/examples/Default96.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default96.hs
@@ -0,0 +1,1 @@
+data Pair = P {a :: !Int}; foo = return $! P{a=undefined}
diff --git a/tests/examples/Default96.hs.expected b/tests/examples/Default96.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default96.hs.expected
@@ -0,0 +1,1 @@
+data Pair = P {a :: !Int}; foo = return $! P{a=undefined}
diff --git a/tests/examples/Default96.hs.refact b/tests/examples/Default96.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default96.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default97.hs b/tests/examples/Default97.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default97.hs
@@ -0,0 +1,1 @@
+data Pair = P {a :: !Int}; foo = return $! P undefined
diff --git a/tests/examples/Default97.hs.expected b/tests/examples/Default97.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default97.hs.expected
@@ -0,0 +1,1 @@
+data Pair = P {a :: !Int}; foo = return $! P undefined
diff --git a/tests/examples/Default97.hs.refact b/tests/examples/Default97.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default97.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Default98.hs b/tests/examples/Default98.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default98.hs
@@ -0,0 +1,1 @@
+foo = return $! Just undefined
diff --git a/tests/examples/Default98.hs.expected b/tests/examples/Default98.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default98.hs.expected
@@ -0,0 +1,1 @@
+foo = return (Just undefined)
diff --git a/tests/examples/Default98.hs.refact b/tests/examples/Default98.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default98.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Default99.hs b/tests/examples/Default99.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default99.hs
@@ -0,0 +1,1 @@
+foo = return $! (a,b)
diff --git a/tests/examples/Default99.hs.expected b/tests/examples/Default99.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default99.hs.expected
@@ -0,0 +1,1 @@
+foo = return (a,b)
diff --git a/tests/examples/Default99.hs.refact b/tests/examples/Default99.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Default99.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Dollar0.hs b/tests/examples/Dollar0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Dollar0.hs
@@ -0,0 +1,1 @@
+yes = concat $ concat $ map f x
diff --git a/tests/examples/Dollar0.hs.expected b/tests/examples/Dollar0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Dollar0.hs.expected
@@ -0,0 +1,1 @@
+yes = concat $ concatMap f x
diff --git a/tests/examples/Dollar0.hs.refact b/tests/examples/Dollar0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Dollar0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Duplicate0.hs b/tests/examples/Duplicate0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate0.hs
@@ -0,0 +1,1 @@
+main = do a; a; a; a
diff --git a/tests/examples/Duplicate0.hs.expected b/tests/examples/Duplicate0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate0.hs.expected
@@ -0,0 +1,1 @@
+main = do a; a; a; a
diff --git a/tests/examples/Duplicate0.hs.refact b/tests/examples/Duplicate0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate0.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Duplicate1.hs b/tests/examples/Duplicate1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate1.hs
@@ -0,0 +1,1 @@
+main = do a; a; a; a; a; a
diff --git a/tests/examples/Duplicate1.hs.expected b/tests/examples/Duplicate1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate1.hs.expected
@@ -0,0 +1,1 @@
+main = do a; a; a; a; a; a
diff --git a/tests/examples/Duplicate1.hs.refact b/tests/examples/Duplicate1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate1.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Duplicate2.hs b/tests/examples/Duplicate2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate2.hs
@@ -0,0 +1,1 @@
+main = do a; a; a; a; a; a; a
diff --git a/tests/examples/Duplicate2.hs.expected b/tests/examples/Duplicate2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate2.hs.expected
@@ -0,0 +1,1 @@
+main = do a; a; a; a; a; a; a
diff --git a/tests/examples/Duplicate2.hs.refact b/tests/examples/Duplicate2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate2.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Duplicate3.hs b/tests/examples/Duplicate3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate3.hs
@@ -0,0 +1,1 @@
+main = do (do b; a; a; a); do (do c; a; a; a)
diff --git a/tests/examples/Duplicate3.hs.expected b/tests/examples/Duplicate3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate3.hs.expected
@@ -0,0 +1,1 @@
+main = do do b; a; a; a; (do c; a; a; a)
diff --git a/tests/examples/Duplicate3.hs.refact b/tests/examples/Duplicate3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Duplicate4.hs b/tests/examples/Duplicate4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate4.hs
@@ -0,0 +1,1 @@
+main = do a; a; a; b; a; a; a
diff --git a/tests/examples/Duplicate4.hs.expected b/tests/examples/Duplicate4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate4.hs.expected
@@ -0,0 +1,1 @@
+main = do a; a; a; b; a; a; a
diff --git a/tests/examples/Duplicate4.hs.refact b/tests/examples/Duplicate4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate4.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Duplicate5.hs b/tests/examples/Duplicate5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate5.hs
@@ -0,0 +1,1 @@
+main = do a; a; a; b; a; a
diff --git a/tests/examples/Duplicate5.hs.expected b/tests/examples/Duplicate5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate5.hs.expected
@@ -0,0 +1,1 @@
+main = do a; a; a; b; a; a
diff --git a/tests/examples/Duplicate5.hs.refact b/tests/examples/Duplicate5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Duplicate6.hs b/tests/examples/Duplicate6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate6.hs
@@ -0,0 +1,1 @@
+foo = a where {a = 1; b = 2; c = 3}; bar = a where {a = 1; b = 2; c = 3}
diff --git a/tests/examples/Duplicate6.hs.expected b/tests/examples/Duplicate6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate6.hs.expected
@@ -0,0 +1,1 @@
+foo = a where {a = 1; b = 2; c = 3}; bar = a where {a = 1; b = 2; c = 3}
diff --git a/tests/examples/Duplicate6.hs.refact b/tests/examples/Duplicate6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Duplicate6.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Extensions0.hs b/tests/examples/Extensions0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions0.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE Arrows #-} 
+f = id
diff --git a/tests/examples/Extensions0.hs.expected b/tests/examples/Extensions0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions0.hs.expected
@@ -0,0 +1,2 @@
+
+f = id
diff --git a/tests/examples/Extensions0.hs.refact b/tests/examples/Extensions0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions0.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions10.hs b/tests/examples/Extensions10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions10.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE ImplicitParams, BangPatterns #-} 
+sort :: (?cmp :: a -> a -> Bool) => [a] -> [a] 
+sort !f = undefined
diff --git a/tests/examples/Extensions10.hs.expected b/tests/examples/Extensions10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions10.hs.expected
@@ -0,0 +1,3 @@
+{-# LANGUAGE ImplicitParams, BangPatterns #-}
+sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]
+sort !f = undefined
diff --git a/tests/examples/Extensions10.hs.refact b/tests/examples/Extensions10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions10.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions11.hs b/tests/examples/Extensions11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions11.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE KindSignatures #-} 
+data Set (cxt :: * -> *) a = Set [a]
diff --git a/tests/examples/Extensions11.hs.expected b/tests/examples/Extensions11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions11.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE KindSignatures #-}
+data Set (cxt :: * -> *) a = Set [a]
diff --git a/tests/examples/Extensions11.hs.refact b/tests/examples/Extensions11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions11.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions12.hs b/tests/examples/Extensions12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions12.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecordWildCards #-} 
+record field = Record{..}
diff --git a/tests/examples/Extensions12.hs.expected b/tests/examples/Extensions12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions12.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecordWildCards #-}
+record field = Record{..}
diff --git a/tests/examples/Extensions12.hs.refact b/tests/examples/Extensions12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions12.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions13.hs b/tests/examples/Extensions13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions13.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecordWildCards #-} 
+record = 1
diff --git a/tests/examples/Extensions13.hs.expected b/tests/examples/Extensions13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions13.hs.expected
@@ -0,0 +1,2 @@
+
+record = 1
diff --git a/tests/examples/Extensions13.hs.refact b/tests/examples/Extensions13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions13.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions14.hs b/tests/examples/Extensions14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions14.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE UnboxedTuples #-} 
+record = 1
diff --git a/tests/examples/Extensions14.hs.expected b/tests/examples/Extensions14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions14.hs.expected
@@ -0,0 +1,2 @@
+
+record = 1
diff --git a/tests/examples/Extensions14.hs.refact b/tests/examples/Extensions14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions14.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions15.hs b/tests/examples/Extensions15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions15.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-} 
+foo
diff --git a/tests/examples/Extensions15.hs.expected b/tests/examples/Extensions15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions15.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-}
+foo
diff --git a/tests/examples/Extensions15.hs.refact b/tests/examples/Extensions15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions15.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions16.hs b/tests/examples/Extensions16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions16.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} 
+record = 1
diff --git a/tests/examples/Extensions16.hs.expected b/tests/examples/Extensions16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions16.hs.expected
@@ -0,0 +1,2 @@
+
+record = 1
diff --git a/tests/examples/Extensions16.hs.refact b/tests/examples/Extensions16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions16.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions17.hs b/tests/examples/Extensions17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions17.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} 
+newtype Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions17.hs.expected b/tests/examples/Extensions17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions17.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+newtype Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions17.hs.refact b/tests/examples/Extensions17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions17.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions18.hs b/tests/examples/Extensions18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions18.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} 
+data Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions18.hs.expected b/tests/examples/Extensions18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions18.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+data Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions18.hs.refact b/tests/examples/Extensions18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions18.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions19.hs b/tests/examples/Extensions19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions19.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} 
+newtype Foo = Foo Int deriving Class
diff --git a/tests/examples/Extensions19.hs.expected b/tests/examples/Extensions19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions19.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+newtype Foo = Foo Int deriving Class
diff --git a/tests/examples/Extensions19.hs.refact b/tests/examples/Extensions19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions19.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions2.hs b/tests/examples/Extensions2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions2.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GADTs, ParallelListComp, ImplicitParams #-}
+f = [(a,c) | a <- b | c <- d]
diff --git a/tests/examples/Extensions2.hs.expected b/tests/examples/Extensions2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions2.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE GADTs, ParallelListComp #-}
+f = [(a,c) | a <- b | c <- d]
diff --git a/tests/examples/Extensions2.hs.refact b/tests/examples/Extensions2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions2.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions20.hs b/tests/examples/Extensions20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions20.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} 
+data Foo = Foo Int deriving Class
diff --git a/tests/examples/Extensions20.hs.expected b/tests/examples/Extensions20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions20.hs.expected
@@ -0,0 +1,2 @@
+
+data Foo = Foo Int deriving Class
diff --git a/tests/examples/Extensions20.hs.refact b/tests/examples/Extensions20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions20.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions21.hs b/tests/examples/Extensions21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions21.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor #-} 
+data Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions21.hs.expected b/tests/examples/Extensions21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions21.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor #-}
+data Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions21.hs.refact b/tests/examples/Extensions21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions21.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions22.hs b/tests/examples/Extensions22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions22.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor #-} 
+newtype Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions22.hs.expected b/tests/examples/Extensions22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions22.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor #-}
+newtype Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions22.hs.refact b/tests/examples/Extensions22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions22.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions23.hs b/tests/examples/Extensions23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions23.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-} 
+newtype Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions23.hs.expected b/tests/examples/Extensions23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions23.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+newtype Foo = Foo Int deriving Functor
diff --git a/tests/examples/Extensions23.hs.refact b/tests/examples/Extensions23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions23.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions24.hs b/tests/examples/Extensions24.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions24.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-} 
+newtype Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions24.hs.expected b/tests/examples/Extensions24.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions24.hs.expected
@@ -0,0 +1,2 @@
+
+newtype Foo = Foo Int deriving Data
diff --git a/tests/examples/Extensions24.hs.refact b/tests/examples/Extensions24.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions24.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions25.hs b/tests/examples/Extensions25.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions25.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-} 
+deriving instance Functor Bar
diff --git a/tests/examples/Extensions25.hs.expected b/tests/examples/Extensions25.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions25.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-}
+deriving instance Functor Bar
diff --git a/tests/examples/Extensions25.hs.refact b/tests/examples/Extensions25.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions25.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions26.hs b/tests/examples/Extensions26.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions26.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving, StandaloneDeriving #-} 
+deriving instance Show Bar
diff --git a/tests/examples/Extensions26.hs.expected b/tests/examples/Extensions26.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions26.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE StandaloneDeriving #-}
+deriving instance Show Bar
diff --git a/tests/examples/Extensions26.hs.refact b/tests/examples/Extensions26.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions26.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions27.hs b/tests/examples/Extensions27.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions27.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving #-} 
+newtype Micro = Micro Int deriving Generic
diff --git a/tests/examples/Extensions27.hs.expected b/tests/examples/Extensions27.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions27.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DeriveGeneric #-}
+newtype Micro = Micro Int deriving Generic
diff --git a/tests/examples/Extensions27.hs.refact b/tests/examples/Extensions27.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions27.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Extensions28.hs b/tests/examples/Extensions28.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions28.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE UnboxedTuples #-} 
+f :: Int -> (# Int, Int #)
diff --git a/tests/examples/Extensions28.hs.expected b/tests/examples/Extensions28.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions28.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE UnboxedTuples #-}
+f :: Int -> (# Int, Int #)
diff --git a/tests/examples/Extensions28.hs.refact b/tests/examples/Extensions28.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions28.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions29.hs b/tests/examples/Extensions29.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions29.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE UnboxedTuples #-} 
+f :: x -> (x, x); f x = (x, x)
diff --git a/tests/examples/Extensions29.hs.expected b/tests/examples/Extensions29.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions29.hs.expected
@@ -0,0 +1,2 @@
+
+f :: x -> (x, x); f x = (x, x)
diff --git a/tests/examples/Extensions29.hs.refact b/tests/examples/Extensions29.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions29.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Extensions3.hs b/tests/examples/Extensions3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions3.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE EmptyDataDecls #-} 
+data Foo
diff --git a/tests/examples/Extensions3.hs.expected b/tests/examples/Extensions3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions3.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE EmptyDataDecls #-}
+data Foo
diff --git a/tests/examples/Extensions3.hs.refact b/tests/examples/Extensions3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions3.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions4.hs b/tests/examples/Extensions4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions4.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-} 
+$(deriveNewtypes typeInfo)
diff --git a/tests/examples/Extensions4.hs.expected b/tests/examples/Extensions4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions4.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-}
+$(deriveNewtypes typeInfo)
diff --git a/tests/examples/Extensions4.hs.refact b/tests/examples/Extensions4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions5.hs b/tests/examples/Extensions5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions5.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-} 
+main = foo ''Bar
diff --git a/tests/examples/Extensions5.hs.expected b/tests/examples/Extensions5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions5.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell #-}
+main = foo ''Bar
diff --git a/tests/examples/Extensions5.hs.refact b/tests/examples/Extensions5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions6.hs b/tests/examples/Extensions6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions6.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE PatternGuards #-} 
+test = case x of _ | y <- z -> w
diff --git a/tests/examples/Extensions6.hs.expected b/tests/examples/Extensions6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions6.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE PatternGuards #-}
+test = case x of _ | y <- z -> w
diff --git a/tests/examples/Extensions6.hs.refact b/tests/examples/Extensions6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions7.hs b/tests/examples/Extensions7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions7.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell,EmptyDataDecls #-} 
+$(fmap return $ dataD (return []) (mkName "Void") [] [] [])
diff --git a/tests/examples/Extensions7.hs.expected b/tests/examples/Extensions7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions7.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE TemplateHaskell,EmptyDataDecls #-}
+$(return Control.Applicative.<$> dataD (return []) (mkName "Void") [] [] [])
diff --git a/tests/examples/Extensions7.hs.refact b/tests/examples/Extensions7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions7.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Extensions8.hs b/tests/examples/Extensions8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions8.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-} 
+main = mdo x <- y; return y
diff --git a/tests/examples/Extensions8.hs.expected b/tests/examples/Extensions8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions8.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-}
+main = mdo x <- y; return y
diff --git a/tests/examples/Extensions8.hs.refact b/tests/examples/Extensions8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Extensions9.hs b/tests/examples/Extensions9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions9.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-} 
+main = do {rec {x <- return 1}; print x}
diff --git a/tests/examples/Extensions9.hs.expected b/tests/examples/Extensions9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions9.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-}
+main = do {rec {x <- return 1}; print x}
diff --git a/tests/examples/Extensions9.hs.refact b/tests/examples/Extensions9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Extensions9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Fixity.hs b/tests/examples/Fixity.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Fixity.hs
@@ -0,0 +1,5 @@
+simple = h <$> (f $ g $ h t)
+
+simple = h <$> (f :+ g :+ h t)
+
+simple = h <$> (f `elem` h `elem` h)
diff --git a/tests/examples/Fixity.hs.expected b/tests/examples/Fixity.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Fixity.hs.expected
@@ -0,0 +1,5 @@
+simple = h <$> f (g $ h t)
+
+simple = h <$> (f :+ g :+ h t)
+
+simple = h <$> (f `elem` h `elem` h)
diff --git a/tests/examples/Fixity.hs.refact b/tests/examples/Fixity.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Fixity.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Import0.hs b/tests/examples/Import0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import0.hs
@@ -0,0 +1,1 @@
+import A; import A
diff --git a/tests/examples/Import0.hs.expected b/tests/examples/Import0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import0.hs.expected
@@ -0,0 +1,1 @@
+import A;
diff --git a/tests/examples/Import0.hs.refact b/tests/examples/Import0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import0.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import1.hs b/tests/examples/Import1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import1.hs
@@ -0,0 +1,1 @@
+import A; import A; import A
diff --git a/tests/examples/Import1.hs.expected b/tests/examples/Import1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import1.hs.expected
@@ -0,0 +1,1 @@
+import A;
diff --git a/tests/examples/Import1.hs.refact b/tests/examples/Import1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import1.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import10.hs b/tests/examples/Import10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import10.hs
@@ -0,0 +1,1 @@
+import A as A
diff --git a/tests/examples/Import10.hs.expected b/tests/examples/Import10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import10.hs.expected
@@ -0,0 +1,1 @@
+import A
diff --git a/tests/examples/Import10.hs.refact b/tests/examples/Import10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import10.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import11.hs b/tests/examples/Import11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import11.hs
@@ -0,0 +1,1 @@
+import qualified A as A
diff --git a/tests/examples/Import11.hs.expected b/tests/examples/Import11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import11.hs.expected
@@ -0,0 +1,1 @@
+import qualified A
diff --git a/tests/examples/Import11.hs.refact b/tests/examples/Import11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import11.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import12.hs b/tests/examples/Import12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import12.hs
@@ -0,0 +1,1 @@
+import A; import B; import A
diff --git a/tests/examples/Import12.hs.expected b/tests/examples/Import12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import12.hs.expected
@@ -0,0 +1,1 @@
+import A; import B;
diff --git a/tests/examples/Import12.hs.refact b/tests/examples/Import12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import12.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import13.hs b/tests/examples/Import13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import13.hs
@@ -0,0 +1,1 @@
+import qualified A; import A
diff --git a/tests/examples/Import13.hs.expected b/tests/examples/Import13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import13.hs.expected
@@ -0,0 +1,1 @@
+import qualified A; import A
diff --git a/tests/examples/Import13.hs.refact b/tests/examples/Import13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import14.hs b/tests/examples/Import14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import14.hs
@@ -0,0 +1,1 @@
+import B; import A; import A
diff --git a/tests/examples/Import14.hs.expected b/tests/examples/Import14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import14.hs.expected
@@ -0,0 +1,1 @@
+import B; import A;
diff --git a/tests/examples/Import14.hs.refact b/tests/examples/Import14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import14.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import15.hs b/tests/examples/Import15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import15.hs
@@ -0,0 +1,1 @@
+import A hiding(Foo); import A hiding(Bar)
diff --git a/tests/examples/Import15.hs.expected b/tests/examples/Import15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import15.hs.expected
@@ -0,0 +1,1 @@
+import A hiding(Foo); import A hiding(Bar)
diff --git a/tests/examples/Import15.hs.refact b/tests/examples/Import15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import15.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import16.hs b/tests/examples/Import16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import16.hs
@@ -0,0 +1,1 @@
+import List
diff --git a/tests/examples/Import16.hs.expected b/tests/examples/Import16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import16.hs.expected
@@ -0,0 +1,1 @@
+import Data.List
diff --git a/tests/examples/Import16.hs.refact b/tests/examples/Import16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import16.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Import17.hs b/tests/examples/Import17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import17.hs
@@ -0,0 +1,1 @@
+import qualified List
diff --git a/tests/examples/Import17.hs.expected b/tests/examples/Import17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import17.hs.expected
@@ -0,0 +1,1 @@
+import qualified Data.List
diff --git a/tests/examples/Import17.hs.refact b/tests/examples/Import17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import17.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Import18.hs b/tests/examples/Import18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import18.hs
@@ -0,0 +1,1 @@
+import Char(foo)
diff --git a/tests/examples/Import18.hs.expected b/tests/examples/Import18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import18.hs.expected
@@ -0,0 +1,1 @@
+import Data.Char(foo)
diff --git a/tests/examples/Import18.hs.refact b/tests/examples/Import18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import18.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Import19.hs b/tests/examples/Import19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import19.hs
@@ -0,0 +1,1 @@
+import IO(foo)
diff --git a/tests/examples/Import19.hs.expected b/tests/examples/Import19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import19.hs.expected
@@ -0,0 +1,1 @@
+import IO(foo)
diff --git a/tests/examples/Import19.hs.refact b/tests/examples/Import19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import19.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import2.hs b/tests/examples/Import2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import2.hs
@@ -0,0 +1,1 @@
+import A(Foo) ; import A
diff --git a/tests/examples/Import2.hs.expected b/tests/examples/Import2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import2.hs.expected
@@ -0,0 +1,1 @@
+ import A
diff --git a/tests/examples/Import2.hs.refact b/tests/examples/Import2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import2.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import20.hs b/tests/examples/Import20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import20.hs
@@ -0,0 +1,1 @@
+import IO as X
diff --git a/tests/examples/Import20.hs.expected b/tests/examples/Import20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import20.hs.expected
@@ -0,0 +1,1 @@
+import IO as X
diff --git a/tests/examples/Import20.hs.refact b/tests/examples/Import20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import20.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Import21.hs b/tests/examples/Import21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import21.hs
@@ -0,0 +1,2 @@
+module Foo(module A, baz, module B, module C) where; import A; import D; import B(map,filter); import C 
+   
diff --git a/tests/examples/Import21.hs.expected b/tests/examples/Import21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import21.hs.expected
@@ -0,0 +1,2 @@
+module Foo(module A, baz, module B, module C) where; import A; import D; import B(map,filter); import C
+
diff --git a/tests/examples/Import21.hs.refact b/tests/examples/Import21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import21.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Import22.hs b/tests/examples/Import22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import22.hs
@@ -0,0 +1,2 @@
+module Foo(module A, baz, module B, module X) where; import A; import B; import X 
+   
diff --git a/tests/examples/Import22.hs.expected b/tests/examples/Import22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import22.hs.expected
@@ -0,0 +1,2 @@
+module Foo(module A, baz, module B, module X) where; import A; import B; import X
+
diff --git a/tests/examples/Import22.hs.refact b/tests/examples/Import22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import22.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Import3.hs b/tests/examples/Import3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import3.hs
@@ -0,0 +1,1 @@
+import A(Bar(..)); import {-# SOURCE #-} A
diff --git a/tests/examples/Import3.hs.expected b/tests/examples/Import3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import3.hs.expected
@@ -0,0 +1,1 @@
+import A(Bar(..)); import {-# SOURCE #-} A
diff --git a/tests/examples/Import3.hs.refact b/tests/examples/Import3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import3.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import4.hs b/tests/examples/Import4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import4.hs
@@ -0,0 +1,1 @@
+import A; import B
diff --git a/tests/examples/Import4.hs.expected b/tests/examples/Import4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import4.hs.expected
@@ -0,0 +1,1 @@
+import A; import B
diff --git a/tests/examples/Import4.hs.refact b/tests/examples/Import4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import5.hs b/tests/examples/Import5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import5.hs
@@ -0,0 +1,1 @@
+import A(B) ; import A(C)
diff --git a/tests/examples/Import5.hs.expected b/tests/examples/Import5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import5.hs.expected
@@ -0,0 +1,1 @@
+import A (B, C) ;
diff --git a/tests/examples/Import5.hs.refact b/tests/examples/Import5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import5.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import6.hs b/tests/examples/Import6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import6.hs
@@ -0,0 +1,1 @@
+import A; import A hiding (C)
diff --git a/tests/examples/Import6.hs.expected b/tests/examples/Import6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import6.hs.expected
@@ -0,0 +1,1 @@
+import A;
diff --git a/tests/examples/Import6.hs.refact b/tests/examples/Import6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import6.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import7.hs b/tests/examples/Import7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import7.hs
@@ -0,0 +1,1 @@
+import A; import A as Y
diff --git a/tests/examples/Import7.hs.expected b/tests/examples/Import7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import7.hs.expected
@@ -0,0 +1,1 @@
+ import A as Y
diff --git a/tests/examples/Import7.hs.refact b/tests/examples/Import7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import7.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Import8.hs b/tests/examples/Import8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import8.hs
@@ -0,0 +1,1 @@
+import A; import qualified A as Y
diff --git a/tests/examples/Import8.hs.expected b/tests/examples/Import8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import8.hs.expected
@@ -0,0 +1,1 @@
+import A; import qualified A as Y
diff --git a/tests/examples/Import8.hs.refact b/tests/examples/Import8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Import9.hs b/tests/examples/Import9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import9.hs
@@ -0,0 +1,1 @@
+import A as B; import A as C
diff --git a/tests/examples/Import9.hs.expected b/tests/examples/Import9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import9.hs.expected
@@ -0,0 +1,1 @@
+import A as B; import A as C
diff --git a/tests/examples/Import9.hs.refact b/tests/examples/Import9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Import9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda0.hs b/tests/examples/Lambda0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda0.hs
@@ -0,0 +1,1 @@
+f a = \x -> x + x
diff --git a/tests/examples/Lambda0.hs.expected b/tests/examples/Lambda0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda0.hs.expected
@@ -0,0 +1,1 @@
+f a x = x + x
diff --git a/tests/examples/Lambda0.hs.refact b/tests/examples/Lambda0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda1.hs b/tests/examples/Lambda1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda1.hs
@@ -0,0 +1,1 @@
+f a = \a -> a + a
diff --git a/tests/examples/Lambda1.hs.expected b/tests/examples/Lambda1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda1.hs.expected
@@ -0,0 +1,1 @@
+f _ a = a + a
diff --git a/tests/examples/Lambda1.hs.refact b/tests/examples/Lambda1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda1.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda10.hs b/tests/examples/Lambda10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda10.hs
@@ -0,0 +1,1 @@
+f = foo (flip op x)
diff --git a/tests/examples/Lambda10.hs.expected b/tests/examples/Lambda10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda10.hs.expected
@@ -0,0 +1,1 @@
+f = foo (flip op x)
diff --git a/tests/examples/Lambda10.hs.refact b/tests/examples/Lambda10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda10.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Lambda10.hs:1:9: Warning: Use section\nFound:\n  (flip op x)\nWhy not:\n  (`op` x)\n",[])]
diff --git a/tests/examples/Lambda11.hs b/tests/examples/Lambda11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda11.hs
@@ -0,0 +1,1 @@
+f = flip op x
diff --git a/tests/examples/Lambda11.hs.expected b/tests/examples/Lambda11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda11.hs.expected
@@ -0,0 +1,1 @@
+f = flip op x
diff --git a/tests/examples/Lambda11.hs.refact b/tests/examples/Lambda11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda11.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda12.hs b/tests/examples/Lambda12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda12.hs
@@ -0,0 +1,1 @@
+f = foo (flip (*) x)
diff --git a/tests/examples/Lambda12.hs.expected b/tests/examples/Lambda12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda12.hs.expected
@@ -0,0 +1,1 @@
+f = foo (flip (*) x)
diff --git a/tests/examples/Lambda12.hs.refact b/tests/examples/Lambda12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda12.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Lambda12.hs:1:9: Warning: Use section\nFound:\n  (flip (*) x)\nWhy not:\n  (* x)\n",[])]
diff --git a/tests/examples/Lambda13.hs b/tests/examples/Lambda13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda13.hs
@@ -0,0 +1,1 @@
+f = foo (flip (-) x)
diff --git a/tests/examples/Lambda13.hs.expected b/tests/examples/Lambda13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda13.hs.expected
@@ -0,0 +1,1 @@
+f = foo (flip (-) x)
diff --git a/tests/examples/Lambda13.hs.refact b/tests/examples/Lambda13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda14.hs b/tests/examples/Lambda14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda14.hs
@@ -0,0 +1,1 @@
+f = foo (\x y -> fun x y)
diff --git a/tests/examples/Lambda14.hs.expected b/tests/examples/Lambda14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda14.hs.expected
@@ -0,0 +1,1 @@
+f = foo (fun)
diff --git a/tests/examples/Lambda14.hs.refact b/tests/examples/Lambda14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda14.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda15.hs b/tests/examples/Lambda15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda15.hs
@@ -0,0 +1,1 @@
+f = foo (\x y -> x + y)
diff --git a/tests/examples/Lambda15.hs.expected b/tests/examples/Lambda15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda15.hs.expected
@@ -0,0 +1,1 @@
+f = foo ((+))
diff --git a/tests/examples/Lambda15.hs.refact b/tests/examples/Lambda15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda15.hs.refact
@@ -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 = "(+)"}])]
diff --git a/tests/examples/Lambda16.hs b/tests/examples/Lambda16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda16.hs
@@ -0,0 +1,1 @@
+f = foo (\x -> x * y)
diff --git a/tests/examples/Lambda16.hs.expected b/tests/examples/Lambda16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda16.hs.expected
@@ -0,0 +1,1 @@
+f = foo ((* y))
diff --git a/tests/examples/Lambda16.hs.refact b/tests/examples/Lambda16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda16.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Lambda17.hs b/tests/examples/Lambda17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda17.hs
@@ -0,0 +1,1 @@
+f = foo (\x -> x # y)
diff --git a/tests/examples/Lambda17.hs.expected b/tests/examples/Lambda17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda17.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\x -> x # y)
diff --git a/tests/examples/Lambda17.hs.refact b/tests/examples/Lambda17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda17.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda18.hs b/tests/examples/Lambda18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda18.hs
@@ -0,0 +1,1 @@
+f = foo (\x -> \y -> x x y y)
diff --git a/tests/examples/Lambda18.hs.expected b/tests/examples/Lambda18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda18.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\ x y -> x x y y)
diff --git a/tests/examples/Lambda18.hs.refact b/tests/examples/Lambda18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda18.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda19.hs b/tests/examples/Lambda19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda19.hs
@@ -0,0 +1,1 @@
+f = foo (\x -> \x -> foo x x)
diff --git a/tests/examples/Lambda19.hs.expected b/tests/examples/Lambda19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda19.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\ _ x -> foo x x)
diff --git a/tests/examples/Lambda19.hs.refact b/tests/examples/Lambda19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda19.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda2.hs b/tests/examples/Lambda2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda2.hs
@@ -0,0 +1,1 @@
+f a = \x -> x + x where _ = test
diff --git a/tests/examples/Lambda2.hs.expected b/tests/examples/Lambda2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda2.hs.expected
@@ -0,0 +1,1 @@
+f a = \x -> x + x where _ = test
diff --git a/tests/examples/Lambda2.hs.refact b/tests/examples/Lambda2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda20.hs b/tests/examples/Lambda20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda20.hs
@@ -0,0 +1,1 @@
+f = foo (\(x:xs) -> \x -> foo x x)
diff --git a/tests/examples/Lambda20.hs.expected b/tests/examples/Lambda20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda20.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\ (x:xs) x -> foo x x)
diff --git a/tests/examples/Lambda20.hs.refact b/tests/examples/Lambda20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda20.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda21.hs b/tests/examples/Lambda21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda21.hs
@@ -0,0 +1,1 @@
+f = foo (\x -> \y -> \z -> x x y y z z)
diff --git a/tests/examples/Lambda21.hs.expected b/tests/examples/Lambda21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda21.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\ x y z -> x x y y z z)
diff --git a/tests/examples/Lambda21.hs.refact b/tests/examples/Lambda21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda21.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda22.hs b/tests/examples/Lambda22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda22.hs
@@ -0,0 +1,1 @@
+x ! y = fromJust $ lookup x y
diff --git a/tests/examples/Lambda22.hs.expected b/tests/examples/Lambda22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda22.hs.expected
@@ -0,0 +1,1 @@
+x ! y = fromJust $ lookup x y
diff --git a/tests/examples/Lambda22.hs.refact b/tests/examples/Lambda22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda22.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda23.hs b/tests/examples/Lambda23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda23.hs
@@ -0,0 +1,1 @@
+f = foo (\i -> writeIdea (getClass i) i)
diff --git a/tests/examples/Lambda23.hs.expected b/tests/examples/Lambda23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda23.hs.expected
@@ -0,0 +1,1 @@
+f = foo (\i -> writeIdea (getClass i) i)
diff --git a/tests/examples/Lambda23.hs.refact b/tests/examples/Lambda23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda23.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda24.hs b/tests/examples/Lambda24.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda24.hs
@@ -0,0 +1,1 @@
+f = bar (flip Foo.bar x)
diff --git a/tests/examples/Lambda24.hs.expected b/tests/examples/Lambda24.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda24.hs.expected
@@ -0,0 +1,1 @@
+f = bar (flip Foo.bar x)
diff --git a/tests/examples/Lambda24.hs.refact b/tests/examples/Lambda24.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda24.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Lambda25.hs b/tests/examples/Lambda25.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda25.hs
@@ -0,0 +1,1 @@
+f = a b (\x -> c x d) 
diff --git a/tests/examples/Lambda25.hs.expected b/tests/examples/Lambda25.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda25.hs.expected
@@ -0,0 +1,1 @@
+f = a b ((`c` d))
diff --git a/tests/examples/Lambda25.hs.refact b/tests/examples/Lambda25.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda25.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Lambda26.hs b/tests/examples/Lambda26.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda26.hs
@@ -0,0 +1,1 @@
+yes = \x -> a x where
diff --git a/tests/examples/Lambda26.hs.expected b/tests/examples/Lambda26.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda26.hs.expected
@@ -0,0 +1,1 @@
+yes = a where
diff --git a/tests/examples/Lambda26.hs.refact b/tests/examples/Lambda26.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda26.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda27.hs b/tests/examples/Lambda27.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda27.hs
@@ -0,0 +1,1 @@
+yes = \x y -> op y x where
diff --git a/tests/examples/Lambda27.hs.expected b/tests/examples/Lambda27.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda27.hs.expected
@@ -0,0 +1,1 @@
+yes = flip op where
diff --git a/tests/examples/Lambda27.hs.refact b/tests/examples/Lambda27.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda27.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda28.hs b/tests/examples/Lambda28.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda28.hs
@@ -0,0 +1,1 @@
+f = \y -> nub $ reverse y where
diff --git a/tests/examples/Lambda28.hs.expected b/tests/examples/Lambda28.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda28.hs.expected
@@ -0,0 +1,1 @@
+f = nub . reverse where
diff --git a/tests/examples/Lambda28.hs.refact b/tests/examples/Lambda28.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda28.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda29.hs b/tests/examples/Lambda29.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda29.hs
@@ -0,0 +1,1 @@
+f = \z -> foo $ bar $ baz z where
diff --git a/tests/examples/Lambda29.hs.expected b/tests/examples/Lambda29.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda29.hs.expected
@@ -0,0 +1,1 @@
+f = foo . bar . baz where
diff --git a/tests/examples/Lambda29.hs.refact b/tests/examples/Lambda29.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda29.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda3.hs b/tests/examples/Lambda3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda3.hs
@@ -0,0 +1,1 @@
+f = \x -> x + x
diff --git a/tests/examples/Lambda3.hs.expected b/tests/examples/Lambda3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda3.hs.expected
@@ -0,0 +1,1 @@
+f x = x + x
diff --git a/tests/examples/Lambda3.hs.refact b/tests/examples/Lambda3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda30.hs b/tests/examples/Lambda30.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda30.hs
@@ -0,0 +1,1 @@
+f = \z -> foo $ bar x $ baz z where
diff --git a/tests/examples/Lambda30.hs.expected b/tests/examples/Lambda30.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda30.hs.expected
@@ -0,0 +1,1 @@
+f = foo . bar x . baz where
diff --git a/tests/examples/Lambda30.hs.refact b/tests/examples/Lambda30.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda30.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda31.hs b/tests/examples/Lambda31.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda31.hs
@@ -0,0 +1,1 @@
+f = \z -> foo $ z $ baz z where
diff --git a/tests/examples/Lambda31.hs.expected b/tests/examples/Lambda31.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda31.hs.expected
@@ -0,0 +1,1 @@
+f = \z -> foo $ z $ baz z where
diff --git a/tests/examples/Lambda31.hs.refact b/tests/examples/Lambda31.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda31.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda32.hs b/tests/examples/Lambda32.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda32.hs
@@ -0,0 +1,1 @@
+f = \x -> bar map (filter x) where
diff --git a/tests/examples/Lambda32.hs.expected b/tests/examples/Lambda32.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda32.hs.expected
@@ -0,0 +1,1 @@
+f = bar map . filter where
diff --git a/tests/examples/Lambda32.hs.refact b/tests/examples/Lambda32.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda32.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda33.hs b/tests/examples/Lambda33.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda33.hs
@@ -0,0 +1,1 @@
+f = bar &+& \x -> f (g x)
diff --git a/tests/examples/Lambda33.hs.expected b/tests/examples/Lambda33.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda33.hs.expected
@@ -0,0 +1,1 @@
+f = bar &+& \x -> f (g x)
diff --git a/tests/examples/Lambda33.hs.refact b/tests/examples/Lambda33.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda33.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda34.hs b/tests/examples/Lambda34.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda34.hs
@@ -0,0 +1,1 @@
+foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]]
diff --git a/tests/examples/Lambda34.hs.expected b/tests/examples/Lambda34.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda34.hs.expected
@@ -0,0 +1,1 @@
+foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]]
diff --git a/tests/examples/Lambda34.hs.refact b/tests/examples/Lambda34.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda34.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda35.hs b/tests/examples/Lambda35.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda35.hs
@@ -0,0 +1,1 @@
+foo = [\x -> x]
diff --git a/tests/examples/Lambda35.hs.expected b/tests/examples/Lambda35.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda35.hs.expected
@@ -0,0 +1,1 @@
+foo = [id]
diff --git a/tests/examples/Lambda35.hs.refact b/tests/examples/Lambda35.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda35.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda36.hs b/tests/examples/Lambda36.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda36.hs
@@ -0,0 +1,1 @@
+foo = [\m x -> insert x x m]
diff --git a/tests/examples/Lambda36.hs.expected b/tests/examples/Lambda36.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda36.hs.expected
@@ -0,0 +1,1 @@
+foo = [\m x -> insert x x m]
diff --git a/tests/examples/Lambda36.hs.refact b/tests/examples/Lambda36.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda36.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda37.hs b/tests/examples/Lambda37.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda37.hs
@@ -0,0 +1,1 @@
+foo a b c = bar (flux ++ quux) c where flux = a
diff --git a/tests/examples/Lambda37.hs.expected b/tests/examples/Lambda37.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda37.hs.expected
@@ -0,0 +1,1 @@
+foo a b = bar (flux ++ quux)
diff --git a/tests/examples/Lambda37.hs.refact b/tests/examples/Lambda37.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda37.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda38.hs b/tests/examples/Lambda38.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda38.hs
@@ -0,0 +1,1 @@
+foo a b c = bar (flux ++ quux) c where flux = c
diff --git a/tests/examples/Lambda38.hs.expected b/tests/examples/Lambda38.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda38.hs.expected
@@ -0,0 +1,1 @@
+foo a b c = bar (flux ++ quux) c where flux = c
diff --git a/tests/examples/Lambda38.hs.refact b/tests/examples/Lambda38.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda38.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda39.hs b/tests/examples/Lambda39.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda39.hs
@@ -0,0 +1,1 @@
+yes = foo (\x -> Just x)
diff --git a/tests/examples/Lambda39.hs.expected b/tests/examples/Lambda39.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda39.hs.expected
@@ -0,0 +1,1 @@
+yes = foo (Just)
diff --git a/tests/examples/Lambda39.hs.refact b/tests/examples/Lambda39.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda39.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda4.hs b/tests/examples/Lambda4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda4.hs
@@ -0,0 +1,1 @@
+fun x y z = f x y z
diff --git a/tests/examples/Lambda4.hs.expected b/tests/examples/Lambda4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda4.hs.expected
@@ -0,0 +1,1 @@
+fun = f
diff --git a/tests/examples/Lambda4.hs.refact b/tests/examples/Lambda4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda40.hs b/tests/examples/Lambda40.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda40.hs
@@ -0,0 +1,1 @@
+foo = bar (\x -> (x `f`))
diff --git a/tests/examples/Lambda40.hs.expected b/tests/examples/Lambda40.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda40.hs.expected
@@ -0,0 +1,1 @@
+foo = bar (f)
diff --git a/tests/examples/Lambda40.hs.refact b/tests/examples/Lambda40.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda40.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda41.hs b/tests/examples/Lambda41.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda41.hs
@@ -0,0 +1,1 @@
+baz = bar (\x -> (x +))
diff --git a/tests/examples/Lambda41.hs.expected b/tests/examples/Lambda41.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda41.hs.expected
@@ -0,0 +1,1 @@
+baz = bar ((+))
diff --git a/tests/examples/Lambda41.hs.refact b/tests/examples/Lambda41.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda41.hs.refact
@@ -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 = "(+)"}])]
diff --git a/tests/examples/Lambda5.hs b/tests/examples/Lambda5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda5.hs
@@ -0,0 +1,1 @@
+fun x y z = f x x y z
diff --git a/tests/examples/Lambda5.hs.expected b/tests/examples/Lambda5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda5.hs.expected
@@ -0,0 +1,1 @@
+fun x = f x x
diff --git a/tests/examples/Lambda5.hs.refact b/tests/examples/Lambda5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda5.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda6.hs b/tests/examples/Lambda6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda6.hs
@@ -0,0 +1,1 @@
+fun x y z = f g z
diff --git a/tests/examples/Lambda6.hs.expected b/tests/examples/Lambda6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda6.hs.expected
@@ -0,0 +1,1 @@
+fun x y = f g
diff --git a/tests/examples/Lambda6.hs.refact b/tests/examples/Lambda6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda6.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Lambda7.hs b/tests/examples/Lambda7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda7.hs
@@ -0,0 +1,1 @@
+fun mr = y mr
diff --git a/tests/examples/Lambda7.hs.expected b/tests/examples/Lambda7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda7.hs.expected
@@ -0,0 +1,1 @@
+fun mr = y mr
diff --git a/tests/examples/Lambda7.hs.refact b/tests/examples/Lambda7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda7.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Lambda8.hs b/tests/examples/Lambda8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda8.hs
@@ -0,0 +1,1 @@
+f = foo ((*) x)
diff --git a/tests/examples/Lambda8.hs.expected b/tests/examples/Lambda8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda8.hs.expected
@@ -0,0 +1,1 @@
+f = foo ((*) x)
diff --git a/tests/examples/Lambda8.hs.refact b/tests/examples/Lambda8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda8.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Lambda8.hs:1:9: Warning: Use section\nFound:\n  ((*) x)\nWhy not:\n  (x *)\n",[])]
diff --git a/tests/examples/Lambda9.hs b/tests/examples/Lambda9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda9.hs
@@ -0,0 +1,1 @@
+f = (*) x
diff --git a/tests/examples/Lambda9.hs.expected b/tests/examples/Lambda9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda9.hs.expected
@@ -0,0 +1,1 @@
+f = (*) x
diff --git a/tests/examples/Lambda9.hs.refact b/tests/examples/Lambda9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Lambda9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/List0.hs b/tests/examples/List0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List0.hs
@@ -0,0 +1,1 @@
+yes = 1:2:[]
diff --git a/tests/examples/List0.hs.expected b/tests/examples/List0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List0.hs.expected
@@ -0,0 +1,1 @@
+yes = [1, 2]
diff --git a/tests/examples/List0.hs.refact b/tests/examples/List0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List0.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/List1.hs b/tests/examples/List1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List1.hs
@@ -0,0 +1,1 @@
+yes = ['h','e','l','l','o']
diff --git a/tests/examples/List1.hs.expected b/tests/examples/List1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List1.hs.expected
@@ -0,0 +1,1 @@
+yes = "hello"
diff --git a/tests/examples/List1.hs.refact b/tests/examples/List1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List1.hs.refact
@@ -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\""}])]
diff --git a/tests/examples/List10.hs b/tests/examples/List10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List10.hs
@@ -0,0 +1,1 @@
+yes = if x == e then l2 ++ xs else [x] ++ check_elem xs
diff --git a/tests/examples/List10.hs.expected b/tests/examples/List10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List10.hs.expected
@@ -0,0 +1,1 @@
+yes = if x == e then l2 ++ xs else x : check_elem xs
diff --git a/tests/examples/List10.hs.refact b/tests/examples/List10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List10.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List11.hs b/tests/examples/List11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List11.hs
@@ -0,0 +1,1 @@
+data Yes = Yes (Maybe [Char])
diff --git a/tests/examples/List11.hs.expected b/tests/examples/List11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List11.hs.expected
@@ -0,0 +1,1 @@
+data Yes = Yes (Maybe String)
diff --git a/tests/examples/List11.hs.refact b/tests/examples/List11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List11.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List12.hs b/tests/examples/List12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List12.hs
@@ -0,0 +1,1 @@
+yes = y :: [Char] -> a
diff --git a/tests/examples/List12.hs.expected b/tests/examples/List12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List12.hs.expected
@@ -0,0 +1,1 @@
+yes = y :: String -> a
diff --git a/tests/examples/List12.hs.refact b/tests/examples/List12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List12.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List13.hs b/tests/examples/List13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List13.hs
@@ -0,0 +1,1 @@
+instance C [Char]
diff --git a/tests/examples/List13.hs.expected b/tests/examples/List13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List13.hs.expected
@@ -0,0 +1,1 @@
+instance C [Char]
diff --git a/tests/examples/List13.hs.refact b/tests/examples/List13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/List14.hs b/tests/examples/List14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List14.hs
@@ -0,0 +1,1 @@
+foo = [a b] ++ xs
diff --git a/tests/examples/List14.hs.expected b/tests/examples/List14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List14.hs.expected
@@ -0,0 +1,1 @@
+foo = a b : xs
diff --git a/tests/examples/List14.hs.refact b/tests/examples/List14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List14.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List2.hs b/tests/examples/List2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List2.hs
@@ -0,0 +1,1 @@
+yes (1:2:[]) = 1
diff --git a/tests/examples/List2.hs.expected b/tests/examples/List2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List2.hs.expected
@@ -0,0 +1,1 @@
+yes [1, 2] = 1
diff --git a/tests/examples/List2.hs.refact b/tests/examples/List2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List2.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/List3.hs b/tests/examples/List3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List3.hs
@@ -0,0 +1,1 @@
+yes ['h','e'] = 1
diff --git a/tests/examples/List3.hs.expected b/tests/examples/List3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List3.hs.expected
@@ -0,0 +1,1 @@
+yes "he" = 1
diff --git a/tests/examples/List3.hs.refact b/tests/examples/List3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List3.hs.refact
@@ -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\""}])]
diff --git a/tests/examples/List4.hs b/tests/examples/List4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List4.hs
@@ -0,0 +1,1 @@
+yes = [x] ++ xs
diff --git a/tests/examples/List4.hs.expected b/tests/examples/List4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List4.hs.expected
@@ -0,0 +1,1 @@
+yes = x : xs
diff --git a/tests/examples/List4.hs.refact b/tests/examples/List4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List5.hs b/tests/examples/List5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List5.hs
@@ -0,0 +1,1 @@
+no = "x" ++ xs
diff --git a/tests/examples/List5.hs.expected b/tests/examples/List5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List5.hs.expected
@@ -0,0 +1,1 @@
+no = "x" ++ xs
diff --git a/tests/examples/List5.hs.refact b/tests/examples/List5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/List6.hs b/tests/examples/List6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List6.hs
@@ -0,0 +1,1 @@
+no = [x] ++ xs ++ ys
diff --git a/tests/examples/List6.hs.expected b/tests/examples/List6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List6.hs.expected
@@ -0,0 +1,1 @@
+no = [x] ++ xs ++ ys
diff --git a/tests/examples/List6.hs.refact b/tests/examples/List6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/List7.hs b/tests/examples/List7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List7.hs
@@ -0,0 +1,1 @@
+no = xs ++ [x] ++ ys
diff --git a/tests/examples/List7.hs.expected b/tests/examples/List7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List7.hs.expected
@@ -0,0 +1,1 @@
+no = xs ++ [x] ++ ys
diff --git a/tests/examples/List7.hs.refact b/tests/examples/List7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List7.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/List8.hs b/tests/examples/List8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List8.hs
@@ -0,0 +1,1 @@
+yes = [if a then b else c] ++ xs
diff --git a/tests/examples/List8.hs.expected b/tests/examples/List8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List8.hs.expected
@@ -0,0 +1,1 @@
+yes = if a then b else c : xs
diff --git a/tests/examples/List8.hs.refact b/tests/examples/List8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List8.hs.refact
@@ -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"}])]
diff --git a/tests/examples/List9.hs b/tests/examples/List9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/List9.hs
@@ -0,0 +1,1 @@
+yes = [1] : [2] : [3] : [4] : [5] : []
diff --git a/tests/examples/List9.hs.expected b/tests/examples/List9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/List9.hs.expected
@@ -0,0 +1,1 @@
+yes = [[1], [2], [3], [4], [5]]
diff --git a/tests/examples/List9.hs.refact b/tests/examples/List9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/List9.hs.refact
@@ -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]"}])]
diff --git a/tests/examples/ListRec0.hs b/tests/examples/ListRec0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec0.hs
@@ -0,0 +1,1 @@
+f (x:xs) = negate x + f xs ; f [] = 0
diff --git a/tests/examples/ListRec0.hs.expected b/tests/examples/ListRec0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec0.hs.expected
@@ -0,0 +1,1 @@
+f xs = foldr ((+) . negate) 0 xs
diff --git a/tests/examples/ListRec0.hs.refact b/tests/examples/ListRec0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec1.hs b/tests/examples/ListRec1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec1.hs
@@ -0,0 +1,1 @@
+f (x:xs) = x + 1 : f xs ; f [] = []
diff --git a/tests/examples/ListRec1.hs.expected b/tests/examples/ListRec1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec1.hs.expected
@@ -0,0 +1,1 @@
+f xs = map (+ 1) xs
diff --git a/tests/examples/ListRec1.hs.refact b/tests/examples/ListRec1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec1.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec2.hs b/tests/examples/ListRec2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec2.hs
@@ -0,0 +1,1 @@
+f z (x:xs) = f (z*x) xs ; f z [] = z
diff --git a/tests/examples/ListRec2.hs.expected b/tests/examples/ListRec2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec2.hs.expected
@@ -0,0 +1,1 @@
+f z xs = foldl (*) z xs
diff --git a/tests/examples/ListRec2.hs.refact b/tests/examples/ListRec2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec2.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec3.hs b/tests/examples/ListRec3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec3.hs
@@ -0,0 +1,1 @@
+f a (x:xs) b = x + a + b : f a xs b ; f a [] b = []
diff --git a/tests/examples/ListRec3.hs.expected b/tests/examples/ListRec3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec3.hs.expected
@@ -0,0 +1,1 @@
+f a xs b = map (\ x -> x + a + b) xs
diff --git a/tests/examples/ListRec3.hs.refact b/tests/examples/ListRec3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec4.hs b/tests/examples/ListRec4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec4.hs
@@ -0,0 +1,1 @@
+f [] a = return a ; f (x:xs) a = a + x >>= \fax -> f xs fax
diff --git a/tests/examples/ListRec4.hs.expected b/tests/examples/ListRec4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec4.hs.expected
@@ -0,0 +1,1 @@
+f xs a = foldM (+) a xs
diff --git a/tests/examples/ListRec4.hs.refact b/tests/examples/ListRec4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec5.hs b/tests/examples/ListRec5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec5.hs
@@ -0,0 +1,1 @@
+foos [] x = x; foos (y:ys) x = foo y $ foos ys x
diff --git a/tests/examples/ListRec5.hs.expected b/tests/examples/ListRec5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec5.hs.expected
@@ -0,0 +1,1 @@
+foos ys x = foldr foo x ys
diff --git a/tests/examples/ListRec5.hs.refact b/tests/examples/ListRec5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec5.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec6.hs b/tests/examples/ListRec6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec6.hs
@@ -0,0 +1,1 @@
+f [] y = y; f (x:xs) y = f xs $ g x y
diff --git a/tests/examples/ListRec6.hs.expected b/tests/examples/ListRec6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec6.hs.expected
@@ -0,0 +1,1 @@
+f xs y = foldl (flip g) y xs
diff --git a/tests/examples/ListRec6.hs.refact b/tests/examples/ListRec6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec6.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec7.hs b/tests/examples/ListRec7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec7.hs
@@ -0,0 +1,1 @@
+f [] y = y; f (x : xs) y = let z = g x y in f xs z
diff --git a/tests/examples/ListRec7.hs.expected b/tests/examples/ListRec7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec7.hs.expected
@@ -0,0 +1,1 @@
+f xs y = foldl (flip g) y xs
diff --git a/tests/examples/ListRec7.hs.refact b/tests/examples/ListRec7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec7.hs.refact
@@ -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"}])]
diff --git a/tests/examples/ListRec8.hs b/tests/examples/ListRec8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec8.hs
@@ -0,0 +1,1 @@
+f [] y = y; f (x:xs) y = f xs (f xs z)
diff --git a/tests/examples/ListRec8.hs.expected b/tests/examples/ListRec8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec8.hs.expected
@@ -0,0 +1,1 @@
+f [] y = y; f (x:xs) y = f xs (f xs z)
diff --git a/tests/examples/ListRec8.hs.refact b/tests/examples/ListRec8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/ListRec8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad0.hs b/tests/examples/Monad0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad0.hs
@@ -0,0 +1,1 @@
+yes = do mapM print a; return b
diff --git a/tests/examples/Monad0.hs.expected b/tests/examples/Monad0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad0.hs.expected
@@ -0,0 +1,1 @@
+yes = do mapM_ print a; return b
diff --git a/tests/examples/Monad0.hs.refact b/tests/examples/Monad0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad0.hs.refact
@@ -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_"}])]
diff --git a/tests/examples/Monad1.hs b/tests/examples/Monad1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad1.hs
@@ -0,0 +1,1 @@
+no = mapM print a
diff --git a/tests/examples/Monad1.hs.expected b/tests/examples/Monad1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad1.hs.expected
@@ -0,0 +1,1 @@
+no = mapM print a
diff --git a/tests/examples/Monad1.hs.refact b/tests/examples/Monad1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad1.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad10.hs b/tests/examples/Monad10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad10.hs
@@ -0,0 +1,1 @@
+yes = do x <- return y; foo x
diff --git a/tests/examples/Monad10.hs.expected b/tests/examples/Monad10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad10.hs.expected
@@ -0,0 +1,1 @@
+yes = do let x = y; foo x
diff --git a/tests/examples/Monad10.hs.refact b/tests/examples/Monad10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad10.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Monad11.hs b/tests/examples/Monad11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad11.hs
@@ -0,0 +1,1 @@
+yes = do x <- return $ y + z; foo x
diff --git a/tests/examples/Monad11.hs.expected b/tests/examples/Monad11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad11.hs.expected
@@ -0,0 +1,1 @@
+yes = do let x = y + z; foo x
diff --git a/tests/examples/Monad11.hs.refact b/tests/examples/Monad11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad11.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Monad12.hs b/tests/examples/Monad12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad12.hs
@@ -0,0 +1,1 @@
+no = do x <- return x; foo x
diff --git a/tests/examples/Monad12.hs.expected b/tests/examples/Monad12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad12.hs.expected
@@ -0,0 +1,1 @@
+no = do x <- return x; foo x
diff --git a/tests/examples/Monad12.hs.refact b/tests/examples/Monad12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad12.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad13.hs b/tests/examples/Monad13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad13.hs
@@ -0,0 +1,1 @@
+no = do x <- return y; x <- return y; foo x
diff --git a/tests/examples/Monad13.hs.expected b/tests/examples/Monad13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad13.hs.expected
@@ -0,0 +1,1 @@
+no = do x <- return y; x <- return y; foo x
diff --git a/tests/examples/Monad13.hs.refact b/tests/examples/Monad13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad14.hs b/tests/examples/Monad14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad14.hs
@@ -0,0 +1,1 @@
+yes = do forM files $ \x -> return (); return ()
diff --git a/tests/examples/Monad14.hs.expected b/tests/examples/Monad14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad14.hs.expected
@@ -0,0 +1,1 @@
+yes = do forM_ files $ \x -> return (); return ()
diff --git a/tests/examples/Monad14.hs.refact b/tests/examples/Monad14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad14.hs.refact
@@ -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_"}])]
diff --git a/tests/examples/Monad15.hs b/tests/examples/Monad15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad15.hs
@@ -0,0 +1,1 @@
+yes = do if a then forM x y else sequence z q; return ()
diff --git a/tests/examples/Monad15.hs.expected b/tests/examples/Monad15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad15.hs.expected
@@ -0,0 +1,1 @@
+yes = do if a then forM_ x y else sequence_ z q; return ()
diff --git a/tests/examples/Monad15.hs.refact b/tests/examples/Monad15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad15.hs.refact
@@ -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_"}])]
diff --git a/tests/examples/Monad16.hs b/tests/examples/Monad16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad16.hs
@@ -0,0 +1,1 @@
+yes = do case a of {_ -> forM x y; x:xs -> forM x xs}; return ()
diff --git a/tests/examples/Monad16.hs.expected b/tests/examples/Monad16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad16.hs.expected
@@ -0,0 +1,1 @@
+yes = do case a of {_ -> forM_ x y; x:xs -> forM_ x xs}; return ()
diff --git a/tests/examples/Monad16.hs.refact b/tests/examples/Monad16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad16.hs.refact
@@ -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_"}])]
diff --git a/tests/examples/Monad17.hs b/tests/examples/Monad17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad17.hs
@@ -0,0 +1,1 @@
+foldM_ f a xs = foldM f a xs >> return ()
diff --git a/tests/examples/Monad17.hs.expected b/tests/examples/Monad17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad17.hs.expected
@@ -0,0 +1,1 @@
+foldM_ f a xs = Control.Monad.void (foldM f a xs)
diff --git a/tests/examples/Monad17.hs.refact b/tests/examples/Monad17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad17.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Monad18.hs b/tests/examples/Monad18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad18.hs
@@ -0,0 +1,1 @@
+folder f a xs = foldM f a xs >> return ()
diff --git a/tests/examples/Monad18.hs.expected b/tests/examples/Monad18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad18.hs.expected
@@ -0,0 +1,1 @@
+folder f a xs = Control.Monad.void (foldM f a xs)
diff --git a/tests/examples/Monad18.hs.refact b/tests/examples/Monad18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad18.hs.refact
@@ -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)"}])]
diff --git a/tests/examples/Monad19.hs b/tests/examples/Monad19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad19.hs
@@ -0,0 +1,1 @@
+yes = mapM async ds >>= mapM wait >> return ()
diff --git a/tests/examples/Monad19.hs.expected b/tests/examples/Monad19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad19.hs.expected
@@ -0,0 +1,1 @@
+yes = mapM async ds >>= mapM_ wait >> return ()
diff --git a/tests/examples/Monad19.hs.refact b/tests/examples/Monad19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad19.hs.refact
@@ -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_"}])]
diff --git a/tests/examples/Monad2.hs b/tests/examples/Monad2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad2.hs
@@ -0,0 +1,1 @@
+no = do foo ; mapM print a
diff --git a/tests/examples/Monad2.hs.expected b/tests/examples/Monad2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad2.hs.expected
@@ -0,0 +1,1 @@
+no = do foo ; mapM print a
diff --git a/tests/examples/Monad2.hs.refact b/tests/examples/Monad2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad3.hs b/tests/examples/Monad3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad3.hs
@@ -0,0 +1,1 @@
+yes = do (bar+foo)
diff --git a/tests/examples/Monad3.hs.expected b/tests/examples/Monad3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad3.hs.expected
@@ -0,0 +1,1 @@
+yes = (bar+foo)
diff --git a/tests/examples/Monad3.hs.refact b/tests/examples/Monad3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Monad4.hs b/tests/examples/Monad4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad4.hs
@@ -0,0 +1,1 @@
+no = do bar ; foo
diff --git a/tests/examples/Monad4.hs.expected b/tests/examples/Monad4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad4.hs.expected
@@ -0,0 +1,1 @@
+no = do bar ; foo
diff --git a/tests/examples/Monad4.hs.refact b/tests/examples/Monad4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad5.hs b/tests/examples/Monad5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad5.hs
@@ -0,0 +1,1 @@
+yes = do bar; a <- foo; return a
diff --git a/tests/examples/Monad5.hs.expected b/tests/examples/Monad5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad5.hs.expected
@@ -0,0 +1,1 @@
+yes = do bar; foo;
diff --git a/tests/examples/Monad5.hs.refact b/tests/examples/Monad5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad5.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Monad6.hs b/tests/examples/Monad6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad6.hs
@@ -0,0 +1,1 @@
+no = do bar; a <- foo; return b
diff --git a/tests/examples/Monad6.hs.expected b/tests/examples/Monad6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad6.hs.expected
@@ -0,0 +1,1 @@
+no = do bar; a <- foo; return b
diff --git a/tests/examples/Monad6.hs.refact b/tests/examples/Monad6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad7.hs b/tests/examples/Monad7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad7.hs
@@ -0,0 +1,1 @@
+yes = do x <- bar; x
diff --git a/tests/examples/Monad7.hs.expected b/tests/examples/Monad7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad7.hs.expected
@@ -0,0 +1,1 @@
+yes = do join bar;
diff --git a/tests/examples/Monad7.hs.refact b/tests/examples/Monad7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad7.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Monad8.hs b/tests/examples/Monad8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad8.hs
@@ -0,0 +1,1 @@
+no = do x <- bar; x; x
diff --git a/tests/examples/Monad8.hs.expected b/tests/examples/Monad8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad8.hs.expected
@@ -0,0 +1,1 @@
+no = do x <- bar; x; x
diff --git a/tests/examples/Monad8.hs.refact b/tests/examples/Monad8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Monad9.hs b/tests/examples/Monad9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad9.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-}
+no = mdo hook <- mkTrigger pat (act >> rmHook hook) ; return hook
diff --git a/tests/examples/Monad9.hs.expected b/tests/examples/Monad9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad9.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE RecursiveDo #-}
+no = mdo hook <- mkTrigger pat (act >> rmHook hook) ; return hook
diff --git a/tests/examples/Monad9.hs.refact b/tests/examples/Monad9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Monad9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming0.hs b/tests/examples/Naming0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming0.hs
@@ -0,0 +1,1 @@
+data Yes = Foo | Bar'Test
diff --git a/tests/examples/Naming0.hs.expected b/tests/examples/Naming0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming0.hs.expected
@@ -0,0 +1,1 @@
+data Yes = Foo | Bar'Test
diff --git a/tests/examples/Naming0.hs.refact b/tests/examples/Naming0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming0.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Naming1.hs b/tests/examples/Naming1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming1.hs
@@ -0,0 +1,1 @@
+data Yes = Bar | Test_Bar
diff --git a/tests/examples/Naming1.hs.expected b/tests/examples/Naming1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming1.hs.expected
@@ -0,0 +1,1 @@
+data Yes = Bar | Test_Bar
diff --git a/tests/examples/Naming1.hs.refact b/tests/examples/Naming1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming1.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Naming10.hs b/tests/examples/Naming10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming10.hs
@@ -0,0 +1,1 @@
+data Yes = FOO_A | Foo_B
diff --git a/tests/examples/Naming10.hs.expected b/tests/examples/Naming10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming10.hs.expected
@@ -0,0 +1,1 @@
+data Yes = FOO_A | Foo_B
diff --git a/tests/examples/Naming10.hs.refact b/tests/examples/Naming10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming10.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Naming11.hs b/tests/examples/Naming11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming11.hs
@@ -0,0 +1,1 @@
+case_foo = 1
diff --git a/tests/examples/Naming11.hs.expected b/tests/examples/Naming11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming11.hs.expected
@@ -0,0 +1,1 @@
+case_foo = 1
diff --git a/tests/examples/Naming11.hs.refact b/tests/examples/Naming11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming11.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming12.hs b/tests/examples/Naming12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming12.hs
@@ -0,0 +1,1 @@
+cast_foo = 1
diff --git a/tests/examples/Naming12.hs.expected b/tests/examples/Naming12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming12.hs.expected
@@ -0,0 +1,1 @@
+cast_foo = 1
diff --git a/tests/examples/Naming12.hs.refact b/tests/examples/Naming12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming12.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Naming12.hs:1:1: Warning: Use camelCase\nFound:\n  cast_foo = ...\nWhy not:\n  castFoo = ...\n",[])]
diff --git a/tests/examples/Naming13.hs b/tests/examples/Naming13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming13.hs
@@ -0,0 +1,1 @@
+replicateM_ = 1
diff --git a/tests/examples/Naming13.hs.expected b/tests/examples/Naming13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming13.hs.expected
@@ -0,0 +1,1 @@
+replicateM_ = 1
diff --git a/tests/examples/Naming13.hs.refact b/tests/examples/Naming13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming14.hs b/tests/examples/Naming14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming14.hs
@@ -0,0 +1,1 @@
+_foo__ = 1
diff --git a/tests/examples/Naming14.hs.expected b/tests/examples/Naming14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming14.hs.expected
@@ -0,0 +1,1 @@
+_foo__ = 1
diff --git a/tests/examples/Naming14.hs.refact b/tests/examples/Naming14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming14.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming15.hs b/tests/examples/Naming15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming15.hs
@@ -0,0 +1,1 @@
+section_1_1 = 1
diff --git a/tests/examples/Naming15.hs.expected b/tests/examples/Naming15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming15.hs.expected
@@ -0,0 +1,1 @@
+section_1_1 = 1
diff --git a/tests/examples/Naming15.hs.refact b/tests/examples/Naming15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming15.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming16.hs b/tests/examples/Naming16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming16.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE MagicHash #-}
+
+runMutator# = 1
diff --git a/tests/examples/Naming16.hs.expected b/tests/examples/Naming16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming16.hs.expected
@@ -0,0 +1,3 @@
+{-# LANGUAGE MagicHash #-}
+
+runMutator# = 1
diff --git a/tests/examples/Naming16.hs.refact b/tests/examples/Naming16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming16.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming2.hs b/tests/examples/Naming2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming2.hs
@@ -0,0 +1,1 @@
+data No = a :::: b
diff --git a/tests/examples/Naming2.hs.expected b/tests/examples/Naming2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming2.hs.expected
@@ -0,0 +1,1 @@
+data No = a :::: b
diff --git a/tests/examples/Naming2.hs.refact b/tests/examples/Naming2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming3.hs b/tests/examples/Naming3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming3.hs
@@ -0,0 +1,1 @@
+data Yes = Foo {bar_cap :: Int}
diff --git a/tests/examples/Naming3.hs.expected b/tests/examples/Naming3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming3.hs.expected
@@ -0,0 +1,1 @@
+data Yes = Foo {bar_cap :: Int}
diff --git a/tests/examples/Naming3.hs.refact b/tests/examples/Naming3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming3.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Naming4.hs b/tests/examples/Naming4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming4.hs
@@ -0,0 +1,1 @@
+data No = FOO | BarBAR | BarBBar
diff --git a/tests/examples/Naming4.hs.expected b/tests/examples/Naming4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming4.hs.expected
@@ -0,0 +1,1 @@
+data No = FOO | BarBAR | BarBBar
diff --git a/tests/examples/Naming4.hs.refact b/tests/examples/Naming4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming5.hs b/tests/examples/Naming5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming5.hs
@@ -0,0 +1,1 @@
+yes_foo = yes_foo + yes_foo
diff --git a/tests/examples/Naming5.hs.expected b/tests/examples/Naming5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming5.hs.expected
@@ -0,0 +1,1 @@
+yes_foo = yes_foo + yes_foo
diff --git a/tests/examples/Naming5.hs.refact b/tests/examples/Naming5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming5.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Naming5.hs:1:1: Warning: Use camelCase\nFound:\n  yes_foo = ...\nWhy not:\n  yesFoo = ...\n",[])]
diff --git a/tests/examples/Naming6.hs b/tests/examples/Naming6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming6.hs
@@ -0,0 +1,1 @@
+no = 1 where yes_foo = 2
diff --git a/tests/examples/Naming6.hs.expected b/tests/examples/Naming6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming6.hs.expected
@@ -0,0 +1,1 @@
+no = 1 where yes_foo = 2
diff --git a/tests/examples/Naming6.hs.refact b/tests/examples/Naming6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming7.hs b/tests/examples/Naming7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming7.hs
@@ -0,0 +1,1 @@
+a -== b = 1
diff --git a/tests/examples/Naming7.hs.expected b/tests/examples/Naming7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming7.hs.expected
@@ -0,0 +1,1 @@
+a -== b = 1
diff --git a/tests/examples/Naming7.hs.refact b/tests/examples/Naming7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming7.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming8.hs b/tests/examples/Naming8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming8.hs
@@ -0,0 +1,1 @@
+myTest = 1; my_test = 1
diff --git a/tests/examples/Naming8.hs.expected b/tests/examples/Naming8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming8.hs.expected
@@ -0,0 +1,1 @@
+myTest = 1; my_test = 1
diff --git a/tests/examples/Naming8.hs.refact b/tests/examples/Naming8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Naming9.hs b/tests/examples/Naming9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming9.hs
@@ -0,0 +1,1 @@
+semiring'laws = 1
diff --git a/tests/examples/Naming9.hs.expected b/tests/examples/Naming9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming9.hs.expected
@@ -0,0 +1,1 @@
+semiring'laws = 1
diff --git a/tests/examples/Naming9.hs.refact b/tests/examples/Naming9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Naming9.hs.refact
@@ -0,0 +1,1 @@
+[("tests/examples/Naming9.hs:1:1: Warning: Use camelCase\nFound:\n  semiring'laws = ...\nWhy not:\n  semiringLaws = ...\n",[])]
diff --git a/tests/examples/NegLit.hs b/tests/examples/NegLit.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/NegLit.hs
@@ -0,0 +1,1 @@
+a = -b/c
diff --git a/tests/examples/NegLit.hs.expected b/tests/examples/NegLit.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/NegLit.hs.expected
@@ -0,0 +1,1 @@
+a = -b/c
diff --git a/tests/examples/NegLit.hs.refact b/tests/examples/NegLit.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/NegLit.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Pragma0.hs b/tests/examples/Pragma0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma0.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -cpp #-}
diff --git a/tests/examples/Pragma0.hs.expected b/tests/examples/Pragma0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma0.hs.expected
@@ -0,0 +1,1 @@
+{-# LANGUAGE CPP #-}
diff --git a/tests/examples/Pragma0.hs.refact b/tests/examples/Pragma0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma0.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma1.hs b/tests/examples/Pragma1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma1.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS     -cpp #-}
diff --git a/tests/examples/Pragma1.hs.expected b/tests/examples/Pragma1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma1.hs.expected
@@ -0,0 +1,1 @@
+{-# LANGUAGE CPP #-}
diff --git a/tests/examples/Pragma1.hs.refact b/tests/examples/Pragma1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma1.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma10.hs b/tests/examples/Pragma10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma10.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs, DataKinds #-}
diff --git a/tests/examples/Pragma10.hs.expected b/tests/examples/Pragma10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma10.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE DataKinds, GADTs #-}
+
diff --git a/tests/examples/Pragma10.hs.refact b/tests/examples/Pragma10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma10.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Pragma2.hs b/tests/examples/Pragma2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma2.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_YHC -cpp #-}
diff --git a/tests/examples/Pragma2.hs.expected b/tests/examples/Pragma2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma2.hs.expected
@@ -0,0 +1,1 @@
+{-# OPTIONS_YHC -cpp #-}
diff --git a/tests/examples/Pragma2.hs.refact b/tests/examples/Pragma2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Pragma3.hs b/tests/examples/Pragma3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma3.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -XFoo #-}
diff --git a/tests/examples/Pragma3.hs.expected b/tests/examples/Pragma3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma3.hs.expected
@@ -0,0 +1,1 @@
+{-# LANGUAGE Foo #-}
diff --git a/tests/examples/Pragma3.hs.refact b/tests/examples/Pragma3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma3.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma4.hs b/tests/examples/Pragma4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma4.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -fglasgow-exts #-}
diff --git a/tests/examples/Pragma4.hs.expected b/tests/examples/Pragma4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma4.hs.expected
@@ -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 #-}
diff --git a/tests/examples/Pragma4.hs.refact b/tests/examples/Pragma4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma4.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma5.hs b/tests/examples/Pragma5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma5.hs
@@ -0,0 +1,1 @@
+{-# LANGUAGE NoMonomorphismRestriction, GADTs, NoMonomorphismRestriction #-}
diff --git a/tests/examples/Pragma5.hs.expected b/tests/examples/Pragma5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma5.hs.expected
@@ -0,0 +1,1 @@
+{-# LANGUAGE NoMonomorphismRestriction, GADTs #-}
diff --git a/tests/examples/Pragma5.hs.refact b/tests/examples/Pragma5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma5.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma6.hs b/tests/examples/Pragma6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma6.hs
@@ -0,0 +1,1 @@
+{-# LANGUAGE GADTs #-}
diff --git a/tests/examples/Pragma6.hs.expected b/tests/examples/Pragma6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma6.hs.expected
@@ -0,0 +1,1 @@
+{-# LANGUAGE GADTs #-}
diff --git a/tests/examples/Pragma6.hs.refact b/tests/examples/Pragma6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Pragma7.hs b/tests/examples/Pragma7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma7.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -XGADTs -main-is Baz #-}
diff --git a/tests/examples/Pragma7.hs.expected b/tests/examples/Pragma7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma7.hs.expected
@@ -0,0 +1,2 @@
+{-# OPTIONS_GHC -main-is Baz #-}
+{-# LANGUAGE GADTs #-}
diff --git a/tests/examples/Pragma7.hs.refact b/tests/examples/Pragma7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma7.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Pragma8.hs b/tests/examples/Pragma8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma8.hs
@@ -0,0 +1,2 @@
+{-# OPTIONS_GHC -XGADTs #-}
+{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
diff --git a/tests/examples/Pragma8.hs.expected b/tests/examples/Pragma8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma8.hs.expected
@@ -0,0 +1,2 @@
+
+{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
diff --git a/tests/examples/Pragma8.hs.refact b/tests/examples/Pragma8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma8.hs.refact
@@ -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 = ""}])]
diff --git a/tests/examples/Pragma9.hs b/tests/examples/Pragma9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma9.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE DataKinds #-}
diff --git a/tests/examples/Pragma9.hs.expected b/tests/examples/Pragma9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma9.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE DataKinds #-}
diff --git a/tests/examples/Pragma9.hs.refact b/tests/examples/Pragma9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Pragma9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/RedundantDo.hs b/tests/examples/RedundantDo.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/RedundantDo.hs
@@ -0,0 +1,4 @@
+foo = do
+  case x of
+    True -> foo
+    False -> foo
diff --git a/tests/examples/RedundantDo.hs.expected b/tests/examples/RedundantDo.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/RedundantDo.hs.expected
@@ -0,0 +1,4 @@
+foo =
+  case x of
+    True -> foo
+    False -> foo
diff --git a/tests/examples/RedundantDo.hs.refact b/tests/examples/RedundantDo.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/RedundantDo.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Remote.hs b/tests/examples/Remote.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Remote.hs
@@ -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))
diff --git a/tests/examples/Remote.hs.expected b/tests/examples/Remote.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Remote.hs.expected
@@ -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))
diff --git a/tests/examples/Remote.hs.refact b/tests/examples/Remote.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Remote.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Sequence.hs b/tests/examples/Sequence.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Sequence.hs
@@ -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)
+
diff --git a/tests/examples/Sequence.hs.expected b/tests/examples/Sequence.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Sequence.hs.expected
@@ -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
+
diff --git a/tests/examples/Sequence.hs.refact b/tests/examples/Sequence.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Sequence.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure0.hs b/tests/examples/Structure0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure0.hs
@@ -0,0 +1,1 @@
+yes x y = if a then b else if c then d else e
diff --git a/tests/examples/Structure0.hs.expected b/tests/examples/Structure0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure0.hs.expected
@@ -0,0 +1,4 @@
+yes x y
+  | a = b
+  | c = d
+  | otherwise = e
diff --git a/tests/examples/Structure0.hs.refact b/tests/examples/Structure0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure0.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure1.hs b/tests/examples/Structure1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure1.hs
@@ -0,0 +1,1 @@
+x `yes` y = if a then b else if c then d else e
diff --git a/tests/examples/Structure1.hs.expected b/tests/examples/Structure1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure1.hs.expected
@@ -0,0 +1,4 @@
+yes x y
+  | a = b
+  | c = d
+  | otherwise = e
diff --git a/tests/examples/Structure1.hs.refact b/tests/examples/Structure1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure1.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure10.hs b/tests/examples/Structure10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure10.hs
@@ -0,0 +1,1 @@
+foo (Bar _ _ _ _) = x
diff --git a/tests/examples/Structure10.hs.expected b/tests/examples/Structure10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure10.hs.expected
@@ -0,0 +1,1 @@
+foo (Bar{}) = x
diff --git a/tests/examples/Structure10.hs.refact b/tests/examples/Structure10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure10.hs.refact
@@ -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{}"}])]
diff --git a/tests/examples/Structure11.hs b/tests/examples/Structure11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure11.hs
@@ -0,0 +1,1 @@
+foo (Bar _ x _ _) = x
diff --git a/tests/examples/Structure11.hs.expected b/tests/examples/Structure11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure11.hs.expected
@@ -0,0 +1,1 @@
+foo (Bar _ x _ _) = x
diff --git a/tests/examples/Structure11.hs.refact b/tests/examples/Structure11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure11.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure12.hs b/tests/examples/Structure12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure12.hs
@@ -0,0 +1,1 @@
+foo (Bar _ _) = x
diff --git a/tests/examples/Structure12.hs.expected b/tests/examples/Structure12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure12.hs.expected
@@ -0,0 +1,1 @@
+foo (Bar _ _) = x
diff --git a/tests/examples/Structure12.hs.refact b/tests/examples/Structure12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure12.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure13.hs b/tests/examples/Structure13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure13.hs
@@ -0,0 +1,1 @@
+foo = case f v of _ -> x
diff --git a/tests/examples/Structure13.hs.expected b/tests/examples/Structure13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure13.hs.expected
@@ -0,0 +1,1 @@
+foo = x
diff --git a/tests/examples/Structure13.hs.refact b/tests/examples/Structure13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure13.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure14.hs b/tests/examples/Structure14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure14.hs
@@ -0,0 +1,1 @@
+foo = case v of v -> x
diff --git a/tests/examples/Structure14.hs.expected b/tests/examples/Structure14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure14.hs.expected
@@ -0,0 +1,1 @@
+foo = x
diff --git a/tests/examples/Structure14.hs.refact b/tests/examples/Structure14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure14.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure15.hs b/tests/examples/Structure15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure15.hs
@@ -0,0 +1,1 @@
+foo = case v of z -> z
diff --git a/tests/examples/Structure15.hs.expected b/tests/examples/Structure15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure15.hs.expected
@@ -0,0 +1,1 @@
+foo = case v of z -> z
diff --git a/tests/examples/Structure15.hs.refact b/tests/examples/Structure15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure15.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure16.hs b/tests/examples/Structure16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure16.hs
@@ -0,0 +1,1 @@
+foo = case v of _ | False -> x
diff --git a/tests/examples/Structure16.hs.expected b/tests/examples/Structure16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure16.hs.expected
@@ -0,0 +1,1 @@
+foo = case v of _ | False -> x
diff --git a/tests/examples/Structure16.hs.refact b/tests/examples/Structure16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure16.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure17.hs b/tests/examples/Structure17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure17.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !True -> x
diff --git a/tests/examples/Structure17.hs.expected b/tests/examples/Structure17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure17.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of True -> x
diff --git a/tests/examples/Structure17.hs.refact b/tests/examples/Structure17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure17.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure18.hs b/tests/examples/Structure18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure18.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !(Just x) -> x
diff --git a/tests/examples/Structure18.hs.expected b/tests/examples/Structure18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure18.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of (Just x) -> x
diff --git a/tests/examples/Structure18.hs.refact b/tests/examples/Structure18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure18.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure19.hs b/tests/examples/Structure19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure19.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !(x : xs) -> x
diff --git a/tests/examples/Structure19.hs.expected b/tests/examples/Structure19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure19.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of (x : xs) -> x
diff --git a/tests/examples/Structure19.hs.refact b/tests/examples/Structure19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure19.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure2.hs b/tests/examples/Structure2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure2.hs
@@ -0,0 +1,1 @@
+no x y = if a then b else c
diff --git a/tests/examples/Structure2.hs.expected b/tests/examples/Structure2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure2.hs.expected
@@ -0,0 +1,1 @@
+no x y = if a then b else c
diff --git a/tests/examples/Structure2.hs.refact b/tests/examples/Structure2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure20.hs b/tests/examples/Structure20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure20.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !1 -> x
diff --git a/tests/examples/Structure20.hs.expected b/tests/examples/Structure20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure20.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of 1 -> x
diff --git a/tests/examples/Structure20.hs.refact b/tests/examples/Structure20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure20.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure21.hs b/tests/examples/Structure21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure21.hs
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !x -> x
diff --git a/tests/examples/Structure21.hs.expected b/tests/examples/Structure21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure21.hs.expected
@@ -0,0 +1,2 @@
+{-# LANGUAGE BangPatterns #-}
+foo = case v of !x -> x
diff --git a/tests/examples/Structure21.hs.refact b/tests/examples/Structure21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure21.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure22.hs b/tests/examples/Structure22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure22.hs
@@ -0,0 +1,1 @@
+foo = let ~x = 1 in y
diff --git a/tests/examples/Structure22.hs.expected b/tests/examples/Structure22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure22.hs.expected
@@ -0,0 +1,1 @@
+foo = let x = 1 in y
diff --git a/tests/examples/Structure22.hs.refact b/tests/examples/Structure22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure22.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure23.hs b/tests/examples/Structure23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure23.hs
@@ -0,0 +1,1 @@
+foo = let ~(x:xs) = y in z
diff --git a/tests/examples/Structure23.hs.expected b/tests/examples/Structure23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure23.hs.expected
@@ -0,0 +1,1 @@
+foo = let ~(x:xs) = y in z
diff --git a/tests/examples/Structure23.hs.refact b/tests/examples/Structure23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure23.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure3.hs b/tests/examples/Structure3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure3.hs
@@ -0,0 +1,1 @@
+foo b | c <- f b = c + b
diff --git a/tests/examples/Structure3.hs.expected b/tests/examples/Structure3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure3.hs.expected
@@ -0,0 +1,1 @@
+foo b | c <- f b = c + b
diff --git a/tests/examples/Structure3.hs.refact b/tests/examples/Structure3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure3.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure4.hs b/tests/examples/Structure4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure4.hs
@@ -0,0 +1,1 @@
+foo b | c <- f b = c where f = here
diff --git a/tests/examples/Structure4.hs.expected b/tests/examples/Structure4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure4.hs.expected
@@ -0,0 +1,1 @@
+foo b | c <- f b = c where f = here
diff --git a/tests/examples/Structure4.hs.refact b/tests/examples/Structure4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure5.hs b/tests/examples/Structure5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure5.hs
@@ -0,0 +1,1 @@
+foo b | c <- f b = c where foo = b
diff --git a/tests/examples/Structure5.hs.expected b/tests/examples/Structure5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure5.hs.expected
@@ -0,0 +1,1 @@
+foo b | c <- f b = c where foo = b
diff --git a/tests/examples/Structure5.hs.refact b/tests/examples/Structure5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure6.hs b/tests/examples/Structure6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure6.hs
@@ -0,0 +1,2 @@
+foo b | c <- f b = c 
+      | c <- f b = c
diff --git a/tests/examples/Structure6.hs.expected b/tests/examples/Structure6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure6.hs.expected
@@ -0,0 +1,2 @@
+foo b | c <- f b = c
+      | c <- f b = c
diff --git a/tests/examples/Structure6.hs.refact b/tests/examples/Structure6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Structure7.hs b/tests/examples/Structure7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure7.hs
@@ -0,0 +1,1 @@
+foo x = yes x x where yes x y = if a then b else if c then d else e
diff --git a/tests/examples/Structure7.hs.expected b/tests/examples/Structure7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure7.hs.expected
@@ -0,0 +1,4 @@
+foo x = yes x x where yes x y
+                        | a = b
+                        | c = d
+                        | otherwise = e
diff --git a/tests/examples/Structure7.hs.refact b/tests/examples/Structure7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure7.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Structure8.hs b/tests/examples/Structure8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure8.hs
@@ -0,0 +1,1 @@
+foo x | otherwise = y
diff --git a/tests/examples/Structure8.hs.expected b/tests/examples/Structure8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure8.hs.expected
@@ -0,0 +1,1 @@
+foo x  = y
diff --git a/tests/examples/Structure8.hs.refact b/tests/examples/Structure8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure8.hs.refact
@@ -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}}])]
diff --git a/tests/examples/Structure9.hs b/tests/examples/Structure9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure9.hs
@@ -0,0 +1,1 @@
+foo x | a = b | True = d
diff --git a/tests/examples/Structure9.hs.expected b/tests/examples/Structure9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure9.hs.expected
@@ -0,0 +1,1 @@
+foo x | a = b | otherwise = d
diff --git a/tests/examples/Structure9.hs.refact b/tests/examples/Structure9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Structure9.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Test0.hs b/tests/examples/Test0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test0.hs
@@ -0,0 +1,2 @@
+main = readFile "foo" >>= putStr            
+ 
diff --git a/tests/examples/Test0.hs.expected b/tests/examples/Test0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test0.hs.expected
@@ -0,0 +1,2 @@
+main = readFile "foo" >>= putStr
+
diff --git a/tests/examples/Test0.hs.refact b/tests/examples/Test0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test0.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test1.hs b/tests/examples/Test1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test1.hs
@@ -0,0 +1,3 @@
+import Prelude hiding(readFile)             
+import Data.ByteString.Char8(readFile)      
+test = readFile "foo" >>= putStr
diff --git a/tests/examples/Test1.hs.expected b/tests/examples/Test1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test1.hs.expected
@@ -0,0 +1,3 @@
+import Prelude hiding(readFile)
+import Data.ByteString.Char8(readFile)
+test = readFile "foo" >>= putStr
diff --git a/tests/examples/Test1.hs.refact b/tests/examples/Test1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test1.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test10.hs b/tests/examples/Test10.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test10.hs
@@ -0,0 +1,1 @@
+type Ignore_Test = Int
diff --git a/tests/examples/Test10.hs.expected b/tests/examples/Test10.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test10.hs.expected
@@ -0,0 +1,1 @@
+type Ignore_Test = Int
diff --git a/tests/examples/Test10.hs.refact b/tests/examples/Test10.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test10.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Test11.hs b/tests/examples/Test11.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test11.hs
@@ -0,0 +1,1 @@
+annTest = foldl
diff --git a/tests/examples/Test11.hs.expected b/tests/examples/Test11.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test11.hs.expected
@@ -0,0 +1,1 @@
+annTest = foldl
diff --git a/tests/examples/Test11.hs.refact b/tests/examples/Test11.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test11.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test12.hs b/tests/examples/Test12.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test12.hs
@@ -0,0 +1,1 @@
+annTest2 = foldl
diff --git a/tests/examples/Test12.hs.expected b/tests/examples/Test12.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test12.hs.expected
@@ -0,0 +1,1 @@
+annTest2 = foldl
diff --git a/tests/examples/Test12.hs.refact b/tests/examples/Test12.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test12.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test13.hs b/tests/examples/Test13.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test13.hs
@@ -0,0 +1,1 @@
+annTest3 = scanr
diff --git a/tests/examples/Test13.hs.expected b/tests/examples/Test13.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test13.hs.expected
@@ -0,0 +1,1 @@
+annTest3 = scanr
diff --git a/tests/examples/Test13.hs.refact b/tests/examples/Test13.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test13.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test14.hs b/tests/examples/Test14.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test14.hs
@@ -0,0 +1,1 @@
+type Ann_Test = Int
diff --git a/tests/examples/Test14.hs.expected b/tests/examples/Test14.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test14.hs.expected
@@ -0,0 +1,1 @@
+type Ann_Test = Int
diff --git a/tests/examples/Test14.hs.refact b/tests/examples/Test14.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test14.hs.refact
@@ -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",[])]
diff --git a/tests/examples/Test15.hs b/tests/examples/Test15.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test15.hs
@@ -0,0 +1,1 @@
+concatMap f x = concat (map f x)
diff --git a/tests/examples/Test15.hs.expected b/tests/examples/Test15.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test15.hs.expected
@@ -0,0 +1,1 @@
+concatMap f x = concat (map f x)
diff --git a/tests/examples/Test15.hs.refact b/tests/examples/Test15.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test15.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test16.hs b/tests/examples/Test16.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test16.hs
@@ -0,0 +1,1 @@
+concatMop f x = concat (map f x)
diff --git a/tests/examples/Test16.hs.expected b/tests/examples/Test16.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test16.hs.expected
@@ -0,0 +1,1 @@
+concatMop f x = concatMap f x
diff --git a/tests/examples/Test16.hs.refact b/tests/examples/Test16.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test16.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Test17.hs b/tests/examples/Test17.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test17.hs
@@ -0,0 +1,1 @@
+yes = 1 * 2+3
diff --git a/tests/examples/Test17.hs.expected b/tests/examples/Test17.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test17.hs.expected
@@ -0,0 +1,1 @@
+yes = 1 * 2+3
diff --git a/tests/examples/Test17.hs.refact b/tests/examples/Test17.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test17.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test18.hs b/tests/examples/Test18.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test18.hs
@@ -0,0 +1,1 @@
+import Foo; test = Foo.id 1
diff --git a/tests/examples/Test18.hs.expected b/tests/examples/Test18.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test18.hs.expected
@@ -0,0 +1,1 @@
+import Foo; test = Foo.id 1
diff --git a/tests/examples/Test18.hs.refact b/tests/examples/Test18.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test18.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test19.hs b/tests/examples/Test19.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test19.hs
@@ -0,0 +1,1 @@
+test = head
diff --git a/tests/examples/Test19.hs.expected b/tests/examples/Test19.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test19.hs.expected
@@ -0,0 +1,1 @@
+test = head
diff --git a/tests/examples/Test19.hs.refact b/tests/examples/Test19.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test19.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test2.hs b/tests/examples/Test2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test2.hs
@@ -0,0 +1,3 @@
+import Prelude as Prelude2                  
+yes = Prelude2.readFile "foo" >>= putStr    
+ 
diff --git a/tests/examples/Test2.hs.expected b/tests/examples/Test2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test2.hs.expected
@@ -0,0 +1,3 @@
+import Prelude as Prelude2
+yes = Prelude2.readFile "foo" >>= putStr
+
diff --git a/tests/examples/Test2.hs.refact b/tests/examples/Test2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test2.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test20.hs b/tests/examples/Test20.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test20.hs
@@ -0,0 +1,1 @@
+import Array; test = Array.head
diff --git a/tests/examples/Test20.hs.expected b/tests/examples/Test20.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test20.hs.expected
@@ -0,0 +1,1 @@
+import Array; test = Array.head
diff --git a/tests/examples/Test20.hs.refact b/tests/examples/Test20.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test20.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test21.hs b/tests/examples/Test21.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test21.hs
@@ -0,0 +1,1 @@
+test = Array.head
diff --git a/tests/examples/Test21.hs.expected b/tests/examples/Test21.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test21.hs.expected
@@ -0,0 +1,1 @@
+test = Array.head
diff --git a/tests/examples/Test21.hs.refact b/tests/examples/Test21.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test21.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test22.hs b/tests/examples/Test22.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test22.hs
@@ -0,0 +1,1 @@
+test = head
diff --git a/tests/examples/Test22.hs.expected b/tests/examples/Test22.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test22.hs.expected
@@ -0,0 +1,1 @@
+test = head
diff --git a/tests/examples/Test22.hs.refact b/tests/examples/Test22.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test22.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test23.hs b/tests/examples/Test23.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test23.hs
@@ -0,0 +1,1 @@
+import qualified Array; test = head
diff --git a/tests/examples/Test23.hs.expected b/tests/examples/Test23.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test23.hs.expected
@@ -0,0 +1,1 @@
+import qualified Array; test = head
diff --git a/tests/examples/Test23.hs.refact b/tests/examples/Test23.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test23.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test24.hs b/tests/examples/Test24.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test24.hs
@@ -0,0 +1,1 @@
+import Array(tail); test = head
diff --git a/tests/examples/Test24.hs.expected b/tests/examples/Test24.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test24.hs.expected
@@ -0,0 +1,1 @@
+import Array(tail); test = head
diff --git a/tests/examples/Test24.hs.refact b/tests/examples/Test24.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test24.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test25.hs b/tests/examples/Test25.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test25.hs
@@ -0,0 +1,1 @@
+import Array(head); test = head
diff --git a/tests/examples/Test25.hs.expected b/tests/examples/Test25.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test25.hs.expected
@@ -0,0 +1,1 @@
+import Array(head); test = head
diff --git a/tests/examples/Test25.hs.refact b/tests/examples/Test25.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test25.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test26.hs b/tests/examples/Test26.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test26.hs
@@ -0,0 +1,1 @@
+import Array as A; test = A.head
diff --git a/tests/examples/Test26.hs.expected b/tests/examples/Test26.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test26.hs.expected
@@ -0,0 +1,1 @@
+import Array as A; test = A.head
diff --git a/tests/examples/Test26.hs.refact b/tests/examples/Test26.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test26.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test27.hs b/tests/examples/Test27.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test27.hs
@@ -0,0 +1,1 @@
+test = tail
diff --git a/tests/examples/Test27.hs.expected b/tests/examples/Test27.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test27.hs.expected
@@ -0,0 +1,1 @@
+test = tail
diff --git a/tests/examples/Test27.hs.refact b/tests/examples/Test27.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test27.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test28.hs b/tests/examples/Test28.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test28.hs
@@ -0,0 +1,1 @@
+import qualified Array as B; test = tail
diff --git a/tests/examples/Test28.hs.expected b/tests/examples/Test28.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test28.hs.expected
@@ -0,0 +1,1 @@
+import qualified Array as B; test = tail
diff --git a/tests/examples/Test28.hs.refact b/tests/examples/Test28.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test28.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test29.hs b/tests/examples/Test29.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test29.hs
@@ -0,0 +1,1 @@
+import Control.Arrow; test = id *** id
diff --git a/tests/examples/Test29.hs.expected b/tests/examples/Test29.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test29.hs.expected
@@ -0,0 +1,1 @@
+import Control.Arrow; test = second id
diff --git a/tests/examples/Test29.hs.refact b/tests/examples/Test29.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test29.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Test3.hs b/tests/examples/Test3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test3.hs
@@ -0,0 +1,1 @@
+yes = 32 :: Int
diff --git a/tests/examples/Test3.hs.expected b/tests/examples/Test3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test3.hs.expected
@@ -0,0 +1,1 @@
+yes = 32 :: Int
diff --git a/tests/examples/Test3.hs.refact b/tests/examples/Test3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test3.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test30.hs b/tests/examples/Test30.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test30.hs
@@ -0,0 +1,1 @@
+test = id Control.Arrow.*** id
diff --git a/tests/examples/Test30.hs.expected b/tests/examples/Test30.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test30.hs.expected
@@ -0,0 +1,1 @@
+test = second id
diff --git a/tests/examples/Test30.hs.refact b/tests/examples/Test30.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test30.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Test31.hs b/tests/examples/Test31.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test31.hs
@@ -0,0 +1,1 @@
+import Control.Arrow as Q; test = id Q.*** id
diff --git a/tests/examples/Test31.hs.expected b/tests/examples/Test31.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test31.hs.expected
@@ -0,0 +1,1 @@
+import Control.Arrow as Q; test = second id
diff --git a/tests/examples/Test31.hs.refact b/tests/examples/Test31.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test31.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Test32.hs b/tests/examples/Test32.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test32.hs
@@ -0,0 +1,1 @@
+zip [1..length x]
diff --git a/tests/examples/Test32.hs.expected b/tests/examples/Test32.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test32.hs.expected
@@ -0,0 +1,1 @@
+zip [1..length x]
diff --git a/tests/examples/Test32.hs.refact b/tests/examples/Test32.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test32.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test33.hs b/tests/examples/Test33.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test33.hs
@@ -0,0 +1,1 @@
+zip [1..length x] x
diff --git a/tests/examples/Test33.hs.expected b/tests/examples/Test33.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test33.hs.expected
@@ -0,0 +1,1 @@
+zip [1..length x] x
diff --git a/tests/examples/Test33.hs.refact b/tests/examples/Test33.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test33.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test34.hs b/tests/examples/Test34.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test34.hs
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} 
+{-# LANGUAGE RecordWildCards #-}
diff --git a/tests/examples/Test34.hs.expected b/tests/examples/Test34.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test34.hs.expected
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}
+{-# LANGUAGE RecordWildCards #-}
diff --git a/tests/examples/Test34.hs.refact b/tests/examples/Test34.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test34.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test35.hs b/tests/examples/Test35.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test35.hs
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} 
+{-# LANGUAGE RecordWildCards #-}
diff --git a/tests/examples/Test35.hs.expected b/tests/examples/Test35.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test35.hs.expected
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}
+{-# LANGUAGE RecordWildCards #-}
diff --git a/tests/examples/Test35.hs.refact b/tests/examples/Test35.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test35.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test37.hs b/tests/examples/Test37.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test37.hs
@@ -0,0 +1,2 @@
+{-# ANN lam "HLint: ignore Redundant lambda" #-} 
+lam = \x -> x x x
diff --git a/tests/examples/Test37.hs.expected b/tests/examples/Test37.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test37.hs.expected
@@ -0,0 +1,2 @@
+{-# ANN lam "HLint: ignore Redundant lambda" #-}
+lam = \x -> x x x
diff --git a/tests/examples/Test37.hs.refact b/tests/examples/Test37.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test37.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test38.hs b/tests/examples/Test38.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test38.hs
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Reduce duplication" #-} 
+dup = do a; a; a; a; a; a
diff --git a/tests/examples/Test38.hs.expected b/tests/examples/Test38.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test38.hs.expected
@@ -0,0 +1,2 @@
+{-# ANN module "HLint: ignore Reduce duplication" #-}
+dup = do a; a; a; a; a; a
diff --git a/tests/examples/Test38.hs.refact b/tests/examples/Test38.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test38.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test4.hs b/tests/examples/Test4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test4.hs
@@ -0,0 +1,1 @@
+yes = before 12
diff --git a/tests/examples/Test4.hs.expected b/tests/examples/Test4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test4.hs.expected
@@ -0,0 +1,1 @@
+yes = before 12
diff --git a/tests/examples/Test4.hs.refact b/tests/examples/Test4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test4.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test5.hs b/tests/examples/Test5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test5.hs
@@ -0,0 +1,1 @@
+ignoreTest = filter
diff --git a/tests/examples/Test5.hs.expected b/tests/examples/Test5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test5.hs.expected
@@ -0,0 +1,1 @@
+ignoreTest = filter
diff --git a/tests/examples/Test5.hs.refact b/tests/examples/Test5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test5.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test6.hs b/tests/examples/Test6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test6.hs
@@ -0,0 +1,1 @@
+ignoreTest2 = filter
diff --git a/tests/examples/Test6.hs.expected b/tests/examples/Test6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test6.hs.expected
@@ -0,0 +1,1 @@
+ignoreTest2 = filter
diff --git a/tests/examples/Test6.hs.refact b/tests/examples/Test6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test7.hs b/tests/examples/Test7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test7.hs
@@ -0,0 +1,1 @@
+ignoreTest3 = filter
diff --git a/tests/examples/Test7.hs.expected b/tests/examples/Test7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test7.hs.expected
@@ -0,0 +1,1 @@
+ignoreTest3 = filter
diff --git a/tests/examples/Test7.hs.refact b/tests/examples/Test7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test7.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test8.hs b/tests/examples/Test8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test8.hs
@@ -0,0 +1,1 @@
+ignoreAny = scanr
diff --git a/tests/examples/Test8.hs.expected b/tests/examples/Test8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test8.hs.expected
@@ -0,0 +1,1 @@
+ignoreAny = scanr
diff --git a/tests/examples/Test8.hs.refact b/tests/examples/Test8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test8.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Test9.hs b/tests/examples/Test9.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test9.hs
@@ -0,0 +1,1 @@
+ignoreNew = foldr
diff --git a/tests/examples/Test9.hs.expected b/tests/examples/Test9.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test9.hs.expected
@@ -0,0 +1,1 @@
+ignoreNew = foldr
diff --git a/tests/examples/Test9.hs.refact b/tests/examples/Test9.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Test9.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Uncurry.hs b/tests/examples/Uncurry.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Uncurry.hs
@@ -0,0 +1,3 @@
+f p = fst p `func` snd p
+
+f p =    fst p .= snd p
diff --git a/tests/examples/Uncurry.hs.expected b/tests/examples/Uncurry.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Uncurry.hs.expected
@@ -0,0 +1,3 @@
+f p = uncurry func p
+
+f p =    uncurry (.=) p
diff --git a/tests/examples/Uncurry.hs.refact b/tests/examples/Uncurry.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Uncurry.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Unsafe0.hs b/tests/examples/Unsafe0.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe0.hs
@@ -0,0 +1,1 @@
+{-# NOINLINE slaves #-}; slaves = unsafePerformIO newIO
diff --git a/tests/examples/Unsafe0.hs.expected b/tests/examples/Unsafe0.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe0.hs.expected
@@ -0,0 +1,1 @@
+{-# NOINLINE slaves #-}; slaves = unsafePerformIO newIO
diff --git a/tests/examples/Unsafe0.hs.refact b/tests/examples/Unsafe0.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe0.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Unsafe1.hs b/tests/examples/Unsafe1.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe1.hs
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO Multimap.newIO
diff --git a/tests/examples/Unsafe1.hs.expected b/tests/examples/Unsafe1.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe1.hs.expected
@@ -0,0 +1,3 @@
+
+{-# NOINLINE slaves #-}
+slaves = unsafePerformIO Multimap.newIO
diff --git a/tests/examples/Unsafe1.hs.refact b/tests/examples/Unsafe1.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe1.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Unsafe2.hs b/tests/examples/Unsafe2.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe2.hs
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO $ f y where foo = 1
diff --git a/tests/examples/Unsafe2.hs.expected b/tests/examples/Unsafe2.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe2.hs.expected
@@ -0,0 +1,3 @@
+
+{-# NOINLINE slaves #-}
+slaves = unsafePerformIO $ f y where foo = 1
diff --git a/tests/examples/Unsafe2.hs.refact b/tests/examples/Unsafe2.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe2.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Unsafe3.hs b/tests/examples/Unsafe3.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe3.hs
@@ -0,0 +1,1 @@
+slaves v = unsafePerformIO $ Multimap.newIO where foo = 1
diff --git a/tests/examples/Unsafe3.hs.expected b/tests/examples/Unsafe3.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe3.hs.expected
@@ -0,0 +1,1 @@
+slaves v = unsafePerformIO Multimap.newIO where foo = 1
diff --git a/tests/examples/Unsafe3.hs.refact b/tests/examples/Unsafe3.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe3.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Unsafe4.hs b/tests/examples/Unsafe4.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe4.hs
@@ -0,0 +1,1 @@
+slaves v = x where x = unsafePerformIO $ Multimap.newIO
diff --git a/tests/examples/Unsafe4.hs.expected b/tests/examples/Unsafe4.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe4.hs.expected
@@ -0,0 +1,1 @@
+slaves v = x where x = unsafePerformIO Multimap.newIO
diff --git a/tests/examples/Unsafe4.hs.refact b/tests/examples/Unsafe4.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe4.hs.refact
@@ -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"}])]
diff --git a/tests/examples/Unsafe5.hs b/tests/examples/Unsafe5.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe5.hs
@@ -0,0 +1,1 @@
+slaves = x where x = unsafePerformIO Multimap.newIO
diff --git a/tests/examples/Unsafe5.hs.expected b/tests/examples/Unsafe5.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe5.hs.expected
@@ -0,0 +1,3 @@
+
+{-# NOINLINE slaves #-}
+slaves = x where x = unsafePerformIO Multimap.newIO
diff --git a/tests/examples/Unsafe5.hs.refact b/tests/examples/Unsafe5.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe5.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Unsafe6.hs b/tests/examples/Unsafe6.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe6.hs
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO . bar
diff --git a/tests/examples/Unsafe6.hs.expected b/tests/examples/Unsafe6.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe6.hs.expected
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO . bar
diff --git a/tests/examples/Unsafe6.hs.refact b/tests/examples/Unsafe6.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe6.hs.refact
@@ -0,0 +1,1 @@
+[]
diff --git a/tests/examples/Unsafe7.hs b/tests/examples/Unsafe7.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe7.hs
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO . baz $ x
diff --git a/tests/examples/Unsafe7.hs.expected b/tests/examples/Unsafe7.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe7.hs.expected
@@ -0,0 +1,3 @@
+
+{-# NOINLINE slaves #-}
+slaves = unsafePerformIO . baz $ x
diff --git a/tests/examples/Unsafe7.hs.refact b/tests/examples/Unsafe7.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe7.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/Unsafe8.hs b/tests/examples/Unsafe8.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe8.hs
@@ -0,0 +1,1 @@
+slaves = unsafePerformIO . baz $ x
diff --git a/tests/examples/Unsafe8.hs.expected b/tests/examples/Unsafe8.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe8.hs.expected
@@ -0,0 +1,3 @@
+
+{-# NOINLINE slaves #-}
+slaves = unsafePerformIO . baz $ x
diff --git a/tests/examples/Unsafe8.hs.refact b/tests/examples/Unsafe8.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/Unsafe8.hs.refact
@@ -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 #-}"}])]
diff --git a/tests/examples/typetest.hs b/tests/examples/typetest.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/typetest.hs
@@ -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 +))
+
+
diff --git a/tests/examples/typetest.hs.expected b/tests/examples/typetest.hs.expected
new file mode 100644
--- /dev/null
+++ b/tests/examples/typetest.hs.expected
@@ -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 ((+))
+
+
diff --git a/tests/examples/typetest.hs.refact b/tests/examples/typetest.hs.refact
new file mode 100644
--- /dev/null
+++ b/tests/examples/typetest.hs.refact
@@ -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 = "(+)"}])]
