packages feed

smuggler2 0.3.4.1 → 0.3.4.2

raw patch · 190 files changed

+2623/−9 lines, 190 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -5,6 +5,9 @@ `smuggler2` uses [PVP Versioning][1]. The change log is available [on GitHub][2]. +##  [0.3.4.2]: --  10 June 2020+- Add test golden files to the distribution+ ##  [0.3.4.1]: --  9 June 2020 - Place output from CPP and literate Haskell sources into new files 
smuggler2.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               smuggler2-version:            0.3.4.1+version:            0.3.4.2 synopsis:   GHC Source Plugin that helps to minimise imports and generate explicit exports @@ -27,7 +27,13 @@   TODO.md  extra-source-files:-  test/tests/*.hs+  test/tests/**/*.hs+  test/tests/**/*.MinimiseImportsNoExportProcessing-golden+  test/tests/**/*.MinimiseImportsReplaceExports-golden+  test/tests/**/*.NoImportProcessingAddExplicitExports-golden+  test/tests/**/*.NoImportProcessingNoExportProcessing-golden+  test/tests/**/*.NoImportProcessingReplaceExports-golden+  test/tests/**/*.PreserveInstanceImportsNoExportProcessing-golden   Makefile   Setup.hs   weeder.dhall@@ -72,15 +78,12 @@    -- Most of these are unnecessary   default-extensions:-    DeriveGeneric-    GeneralizedNewtypeDeriving+    FlexibleContexts+    FlexibleInstances     InstanceSigs     LambdaCase-    OverloadedStrings-    RecordWildCards-    ScopedTypeVariables-    StandaloneDeriving-    TypeApplications+    MultiParamTypeClasses+    TupleSections  common executable-options   ghc-options: -rtsopts
+ test/tests/Bare.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+++main = undefined
+ test/tests/Bare.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,3 @@+++main = undefined
+ test/tests/Bare.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,4 @@++import Data.List++main = undefined
+ test/tests/Bare.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Bare.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,4 @@++import Data.List++main = undefined
+ test/tests/Bare.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+++import Data.List ()++main = undefined
+ test/tests/BareHello.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BareHello.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module BareHello (+  main ) where++main = putStrLn "Hello, World"
+ test/tests/BareHello.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,4 @@+module BareHello (+  main ) where++main = putStrLn "Hello, World"
+ test/tests/BareHello.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BareHello.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,4 @@+module BareHello (+  main ) where++main = putStrLn "Hello, World"
+ test/tests/BareHello.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BoolBoolUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+module Test.BoolBoolUnused where
+ test/tests/BoolBoolUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,1 @@+module Test.BoolBoolUnused where
+ test/tests/BoolBoolUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,3 @@+module Test.BoolBoolUnused where++import Data.Bool (bool)
+ test/tests/BoolBoolUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BoolBoolUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,3 @@+module Test.BoolBoolUnused where++import Data.Bool (bool)
+ test/tests/BoolBoolUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.BoolBoolUnused where++import Data.Bool ()
+ test/tests/BoolBoolUsed.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.BoolBoolUsed where++import Data.Bool ( bool )++func = bool
+ test/tests/BoolBoolUsed.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolBoolUsed (+  func ) where++import Data.Bool ( bool )++func = bool
+ test/tests/BoolBoolUsed.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolBoolUsed (+  func ) where++import Data.Bool (bool)++func = bool
+ test/tests/BoolBoolUsed.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BoolBoolUsed.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolBoolUsed (+  func ) where++import Data.Bool (bool)++func = bool
+ test/tests/BoolBoolUsed.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.BoolBoolUsed where++import Data.Bool ( bool )++func = bool
+ test/tests/BoolPartlyUsedFirst.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.BoolPartlyUsedFirst where++import Data.Bool ( bool )++foo = bool
+ test/tests/BoolPartlyUsedFirst.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolPartlyUsedFirst (+  foo ) where++import Data.Bool ( bool )++foo = bool
+ test/tests/BoolPartlyUsedFirst.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolPartlyUsedFirst (+  foo ) where++import Data.Bool (bool, not)++foo = bool
+ test/tests/BoolPartlyUsedFirst.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BoolPartlyUsedFirst.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolPartlyUsedFirst (+  foo ) where++import Data.Bool (bool, not)++foo = bool
+ test/tests/BoolPartlyUsedFirst.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.BoolPartlyUsedFirst where++import Data.Bool ( bool )++foo = bool
+ test/tests/BoolPartlyUsedLast.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.BoolPartlyUsedLast where++foo = not
+ test/tests/BoolPartlyUsedLast.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.BoolPartlyUsedLast (+  foo ) where++foo = not
+ test/tests/BoolPartlyUsedLast.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolPartlyUsedLast (+  foo ) where++import Data.Bool (bool, not)++foo = not
+ test/tests/BoolPartlyUsedLast.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/BoolPartlyUsedLast.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.BoolPartlyUsedLast (+  foo ) where++import Data.Bool (bool, not)++foo = not
+ test/tests/BoolPartlyUsedLast.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.BoolPartlyUsedLast where++import Data.Bool ()++foo = not
+ test/tests/CPP.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/CPP.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/CPP.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/CPP.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/CPP.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/CPP.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Class.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Class.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,45 @@+module Class (+  CatchImpossible(..),+  Impossible(..),+  Record(..) ) where+++data Record a = Record { aa :: a,  b :: String }++data Impossible++  = Impossible  String Integer+    -- ^ We reached a program point which should be unreachable.++  | Unreachable String Integer+    -- ^ @Impossible@ with a different error message.+    --   Used when we reach a program point which can in principle+    --   be reached, but not for a certain run.++  | ImpMissingDefinitions [String] String+    -- ^ We reached a program point without all the required+    -- primitives or BUILTIN to proceed forward.+    -- @ImpMissingDefinitions neededDefs forThis@+++class CatchImpossible m where++  -- | Catch any 'Impossible' exception.+  catchImpossible :: m a -> (Impossible -> m a) -> m a+  catchImpossible = catchImpossibleJust Just++  -- | Catch only 'Impossible' exceptions selected by the filter.+  catchImpossibleJust :: (Impossible -> Maybe b) -> m a -> (b -> m a) -> m a+  catchImpossibleJust = flip . handleImpossibleJust++  -- | Version of 'catchImpossible' with argument order suiting short handlers.+  handleImpossible :: (Impossible -> m a) -> m a -> m a+  handleImpossible = flip catchImpossible++  -- | Version of 'catchImpossibleJust' with argument order suiting short handlers.+  handleImpossibleJust :: (Impossible -> Maybe b) -> (b -> m a) -> m a -> m a+  handleImpossibleJust = flip . catchImpossibleJust++  {-# MINIMAL catchImpossibleJust | handleImpossibleJust #-}++
+ test/tests/Class.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,45 @@+module Class (+  CatchImpossible(..),+  Impossible(..),+  Record(..) ) where+++data Record a = Record { aa :: a,  b :: String }++data Impossible++  = Impossible  String Integer+    -- ^ We reached a program point which should be unreachable.++  | Unreachable String Integer+    -- ^ @Impossible@ with a different error message.+    --   Used when we reach a program point which can in principle+    --   be reached, but not for a certain run.++  | ImpMissingDefinitions [String] String+    -- ^ We reached a program point without all the required+    -- primitives or BUILTIN to proceed forward.+    -- @ImpMissingDefinitions neededDefs forThis@+++class CatchImpossible m where++  -- | Catch any 'Impossible' exception.+  catchImpossible :: m a -> (Impossible -> m a) -> m a+  catchImpossible = catchImpossibleJust Just++  -- | Catch only 'Impossible' exceptions selected by the filter.+  catchImpossibleJust :: (Impossible -> Maybe b) -> m a -> (b -> m a) -> m a+  catchImpossibleJust = flip . handleImpossibleJust++  -- | Version of 'catchImpossible' with argument order suiting short handlers.+  handleImpossible :: (Impossible -> m a) -> m a -> m a+  handleImpossible = flip catchImpossible++  -- | Version of 'catchImpossibleJust' with argument order suiting short handlers.+  handleImpossibleJust :: (Impossible -> Maybe b) -> (b -> m a) -> m a -> m a+  handleImpossibleJust = flip . catchImpossibleJust++  {-# MINIMAL catchImpossibleJust | handleImpossibleJust #-}++
+ test/tests/Class.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Class.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,45 @@+module Class (+  CatchImpossible(..),+  Impossible(..),+  Record(..) ) where+++data Record a = Record { aa :: a,  b :: String }++data Impossible++  = Impossible  String Integer+    -- ^ We reached a program point which should be unreachable.++  | Unreachable String Integer+    -- ^ @Impossible@ with a different error message.+    --   Used when we reach a program point which can in principle+    --   be reached, but not for a certain run.++  | ImpMissingDefinitions [String] String+    -- ^ We reached a program point without all the required+    -- primitives or BUILTIN to proceed forward.+    -- @ImpMissingDefinitions neededDefs forThis@+++class CatchImpossible m where++  -- | Catch any 'Impossible' exception.+  catchImpossible :: m a -> (Impossible -> m a) -> m a+  catchImpossible = catchImpossibleJust Just++  -- | Catch only 'Impossible' exceptions selected by the filter.+  catchImpossibleJust :: (Impossible -> Maybe b) -> m a -> (b -> m a) -> m a+  catchImpossibleJust = flip . handleImpossibleJust++  -- | Version of 'catchImpossible' with argument order suiting short handlers.+  handleImpossible :: (Impossible -> m a) -> m a -> m a+  handleImpossible = flip catchImpossible++  -- | Version of 'catchImpossibleJust' with argument order suiting short handlers.+  handleImpossibleJust :: (Impossible -> Maybe b) -> (b -> m a) -> m a -> m a+  handleImpossibleJust = flip . catchImpossibleJust++  {-# MINIMAL catchImpossibleJust | handleImpossibleJust #-}++
+ test/tests/Class.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ConstructorsUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.ConstructorsUnused where++foo = not
+ test/tests/ConstructorsUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.ConstructorsUnused (+  foo ) where++foo = not
+ test/tests/ConstructorsUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.ConstructorsUnused (+  foo ) where++import Data.Bool (Bool (True, False), not)++foo = not
+ test/tests/ConstructorsUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ConstructorsUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.ConstructorsUnused (+  foo ) where++import Data.Bool (Bool (True, False), not)++foo = not
+ test/tests/ConstructorsUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.ConstructorsUnused where++import Data.Bool ()++foo = not
+ test/tests/Dummy.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Dummy.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,5 @@+module Test.Dummy (+  main ) where++main :: IO ()+main = pure ()
+ test/tests/Dummy.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,5 @@+module Test.Dummy (+  main ) where++main :: IO ()+main = pure ()
+ test/tests/Dummy.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Dummy.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,5 @@+module Test.Dummy (+  main ) where++main :: IO ()+main = pure ()
+ test/tests/Dummy.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Duplicated.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,7 @@+module Duplicated where++import Data.Char ( isDigit )+import Data.Char ( isLetter )+++test x = isDigit x || isLetter x
+ test/tests/Duplicated.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,8 @@+module Duplicated (+  test ) where++import Data.Char ( isDigit )+import Data.Char ( isLetter )+++test x = isDigit x || isLetter x
+ test/tests/Duplicated.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,9 @@+module Duplicated (+  test ) where++import Data.Char (isDigit, isSpace)+import Data.Char (isPrint, isSpace)+import Data.Char (isLetter, isSpace)+++test x = isDigit x || isLetter x
+ test/tests/Duplicated.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Duplicated.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,9 @@+module Duplicated (+  test ) where++import Data.Char (isDigit, isSpace)+import Data.Char (isPrint, isSpace)+import Data.Char (isLetter, isSpace)+++test x = isDigit x || isLetter x
+ test/tests/Duplicated.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,8 @@+module Duplicated where++import Data.Char ( isDigit )+import Data.Char ()+import Data.Char ( isLetter )+++test x = isDigit x || isLetter x
+ test/tests/ExportExplicit.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportExplicit.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,14 @@+module Test.ExportExplicit (+  isExported,+  anotherExport,+  andAnother,+  main ) where++isExported = (+1)++anotherExport = True++andAnother = 27++main :: IO ()+main = pure ()
+ test/tests/ExportExplicit.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,10 @@+module Test.ExportExplicit (isExported, anotherExport) where++isExported = (+1)++anotherExport = True++andAnother = 27++main :: IO ()+main = pure ()
+ test/tests/ExportExplicit.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportExplicit.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,14 @@+module Test.ExportExplicit (+  isExported,+  anotherExport,+  andAnother,+  main ) where++isExported = (+1)++anotherExport = True++andAnother = 27++main :: IO ()+main = pure ()
+ test/tests/ExportExplicit.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportImplicit.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportImplicit.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,13 @@+module Test.ExportImplicit (+  isExported,+  alsoExported,+  main ) where++import Data.Char ( toLower )++isExported = (+1)++alsoExported = map toLower "AbC"++main :: IO ()+main = print $ isExported 1
+ test/tests/ExportImplicit.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,13 @@+module Test.ExportImplicit (+  isExported,+  alsoExported,+  main ) where++import Data.Char++isExported = (+1)++alsoExported = map toLower "AbC"++main :: IO ()+main = print $ isExported 1
+ test/tests/ExportImplicit.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportImplicit.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,13 @@+module Test.ExportImplicit (+  isExported,+  alsoExported,+  main ) where++import Data.Char++isExported = (+1)++alsoExported = map toLower "AbC"++main :: IO ()+main = print $ isExported 1
+ test/tests/ExportImplicit.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportPattern2.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportPattern2.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,161 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ExportPattern2 (+  T(..),+  Nat(..),+  Showable(..),+  Type(..),+  pattern ExNumPat,+  pattern Head,+  pattern Single,+  pattern Ess,+  pattern Pair,+  pattern One,+  pattern Sh,+  pattern Succ,+  pattern (:>),+  pattern (:<),+  pattern Empty,+  pattern Maybe,+  pattern Int,+  pattern Arrow,+  pattern P ) where++import Control.Monad ( guard )+import qualified Data.Sequence as Seq+    ( viewl, viewr, ViewL((:<), EmptyL), ViewR((:>)) )++pattern P = 42++--useP P = 43++--++data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]+++{-+collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow+-}++--+++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)++{-+viewPL (x :< Empty) = x+viewPR (Empty :> y) = y+-}++--+++pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1++{-+fac (Succ n) = Succ n * fac n+fac 0 = 1+-}++--+++data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x++{-+showable :: (Show a) => a -> Showable+showable x = MkShowable x+-}++--+++-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+++-- one One = 2++--+++pattern Pair x y <- [x, y]++++{-+f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+-}++++--++data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+++--two = S ( S Z)++--++pattern Single x = [x]++pattern Head x <- x : xs++{- single (Single x) = x+hd :: [a] -> a+hd (Head x) = x+-}++--+++data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x++{-+h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x+-}
+ test/tests/ExportPattern2.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,160 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ExportPattern2 (+  T(..),+  Nat(..),+  Showable(..),+  Type(..),+  pattern ExNumPat,+  pattern Head,+  pattern Single,+  pattern Ess,+  pattern Pair,+  pattern One,+  pattern Sh,+  pattern Succ,+  pattern (:>),+  pattern (:<),+  pattern Empty,+  pattern Maybe,+  pattern Int,+  pattern Arrow,+  pattern P ) where++import Control.Monad (guard)+import qualified Data.Sequence as Seq++pattern P = 42++--useP P = 43++--++data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]+++{-+collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow+-}++--+++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)++{-+viewPL (x :< Empty) = x+viewPR (Empty :> y) = y+-}++--+++pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1++{-+fac (Succ n) = Succ n * fac n+fac 0 = 1+-}++--+++data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x++{-+showable :: (Show a) => a -> Showable+showable x = MkShowable x+-}++--+++-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+++-- one One = 2++--+++pattern Pair x y <- [x, y]++++{-+f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+-}++++--++data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+++--two = S ( S Z)++--++pattern Single x = [x]++pattern Head x <- x : xs++{- single (Single x) = x+hd :: [a] -> a+hd (Head x) = x+-}++--+++data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x++{-+h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x+-}
+ test/tests/ExportPattern2.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ExportPattern2.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,160 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ExportPattern2 (+  T(..),+  Nat(..),+  Showable(..),+  Type(..),+  pattern ExNumPat,+  pattern Head,+  pattern Single,+  pattern Ess,+  pattern Pair,+  pattern One,+  pattern Sh,+  pattern Succ,+  pattern (:>),+  pattern (:<),+  pattern Empty,+  pattern Maybe,+  pattern Int,+  pattern Arrow,+  pattern P ) where++import Control.Monad (guard)+import qualified Data.Sequence as Seq++pattern P = 42++--useP P = 43++--++data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]+++{-+collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow+-}++--+++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)++{-+viewPL (x :< Empty) = x+viewPR (Empty :> y) = y+-}++--+++pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1++{-+fac (Succ n) = Succ n * fac n+fac 0 = 1+-}++--+++data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x++{-+showable :: (Show a) => a -> Showable+showable x = MkShowable x+-}++--+++-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+++-- one One = 2++--+++pattern Pair x y <- [x, y]++++{-+f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+-}++++--++data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+++--two = S ( S Z)++--++pattern Single x = [x]++pattern Head x <- x : xs++{- single (Single x) = x+hd :: [a] -> a+hd (Head x) = x+-}++--+++data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x++{-+h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x+-}
+ test/tests/ExportPattern2.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ImplicitImportUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,7 @@+module Test.ImplicitImportUnused where++import Data.Maybe ( isJust )++foo = isJust++bar = 27
+ test/tests/ImplicitImportUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,9 @@+module Test.ImplicitImportUnused (+  foo,+  bar ) where++import Data.Maybe ( isJust )++foo = isJust++bar = 27
+ test/tests/ImplicitImportUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,11 @@+module Test.ImplicitImportUnused (+  foo,+  bar ) where++import Data.List+import Data.Bool (not, (&&))+import Data.Maybe (fromMaybe, isJust, isNothing)++foo = isJust++bar = 27
+ test/tests/ImplicitImportUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ImplicitImportUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,11 @@+module Test.ImplicitImportUnused (+  foo,+  bar ) where++import Data.List+import Data.Bool (not, (&&))+import Data.Maybe (fromMaybe, isJust, isNothing)++foo = isJust++bar = 27
+ test/tests/ImplicitImportUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,9 @@+module Test.ImplicitImportUnused where++import Data.List ()+import Data.Bool ()+import Data.Maybe ( isJust )++foo = isJust++bar = 27
+ test/tests/ImplicitImportUsed.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.ImplicitImportUsed where++import Data.List ( intercalate )++foo = intercalate ","
+ test/tests/ImplicitImportUsed.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.ImplicitImportUsed (+  foo ) where++import Data.List ( intercalate )++foo = intercalate ","
+ test/tests/ImplicitImportUsed.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.ImplicitImportUsed (+  foo ) where++import Data.List++foo = intercalate ","
+ test/tests/ImplicitImportUsed.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ImplicitImportUsed.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.ImplicitImportUsed (+  foo ) where++import Data.List++foo = intercalate ","
+ test/tests/ImplicitImportUsed.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.ImplicitImportUsed where++import Data.List ( intercalate )++foo = intercalate ","
+ test/tests/ImportEmpty.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+module Test.ImportEmpty where
+ test/tests/ImportEmpty.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,1 @@+module Test.ImportEmpty where
+ test/tests/ImportEmpty.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,3 @@+module Test.ImportEmpty where++import Data.Bool ()
+ test/tests/ImportEmpty.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ImportEmpty.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,3 @@+module Test.ImportEmpty where++import Data.Bool ()
+ test/tests/ImportEmpty.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.ImportEmpty where++import Data.Bool ()
+ test/tests/ImportPattern.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,147 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ImportPattern where++import Imported.ExportPattern+    ( T,+      Nat(Z, S),+      Showable(..),+      Type,+      pattern ExNumPat,+      pattern Head,+      pattern Single,+      pattern Pair,+      pattern One,+      pattern Succ,+      pattern (:>),+      pattern (:<),+      pattern Empty,+      pattern Int,+      pattern Arrow,+      pattern P )++-- pattern P = 42++useP P = 43++--++{-+data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]++-}++collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow++--+{-++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)+-}++viewPL (x :< Empty) = x+viewPR (Empty :> y) = y++--++{-+pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1+-}++fac (Succ n) = Succ n * fac n+fac 0 = 1++--++{-+data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x+-}++showable :: (Show a) => a -> Showable+showable x = MkShowable x++--++{-+-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+-}++one One = 2++--+++--pattern Pair x y <- [x, y]+++f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+++--+{-+data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+-}++two = S ( S Z)++--++-- pattern Single x = [x]++-- pattern Head x <- x : xs++single (Single x) = x+hd :: [a] -> a+hd (Head x) = x++--++{-+data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x+-}++h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x
+ test/tests/ImportPattern.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,163 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ImportPattern (+  useP,+  collectArgs,+  isInt,+  isIntEndo,+  arrows,+  viewPL,+  viewPR,+  fac,+  showable,+  one,+  f,+  g,+  two,+  single,+  hd,+  h ) where++import Imported.ExportPattern+    ( T,+      Nat(Z, S),+      Showable(..),+      Type,+      pattern ExNumPat,+      pattern Head,+      pattern Single,+      pattern Pair,+      pattern One,+      pattern Succ,+      pattern (:>),+      pattern (:<),+      pattern Empty,+      pattern Int,+      pattern Arrow,+      pattern P )++-- pattern P = 42++useP P = 43++--++{-+data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]++-}++collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow++--+{-++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)+-}++viewPL (x :< Empty) = x+viewPR (Empty :> y) = y++--++{-+pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1+-}++fac (Succ n) = Succ n * fac n+fac 0 = 1++--++{-+data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x+-}++showable :: (Show a) => a -> Showable+showable x = MkShowable x++--++{-+-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+-}++one One = 2++--+++--pattern Pair x y <- [x, y]+++f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+++--+{-+data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+-}++two = S ( S Z)++--++-- pattern Single x = [x]++-- pattern Head x <- x : xs++single (Single x) = x+hd :: [a] -> a+hd (Head x) = x++--++{-+data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x+-}++h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x
+ test/tests/ImportPattern.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,150 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ImportPattern (+  useP,+  collectArgs,+  isInt,+  isIntEndo,+  arrows,+  viewPL,+  viewPR,+  fac,+  showable,+  one,+  f,+  g,+  two,+  single,+  hd,+  h ) where++import Control.Monad (guard)+import qualified Data.Sequence as Seq++import Imported.ExportPattern++-- pattern P = 42++useP P = 43++--++{-+data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]++-}++collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow++--+{-++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)+-}++viewPL (x :< Empty) = x+viewPR (Empty :> y) = y++--++{-+pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1+-}++fac (Succ n) = Succ n * fac n+fac 0 = 1++--++{-+data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x+-}++showable :: (Show a) => a -> Showable+showable x = MkShowable x++--++{-+-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+-}++one One = 2++--+++--pattern Pair x y <- [x, y]+++f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+++--+{-+data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+-}++two = S ( S Z)++--++-- pattern Single x = [x]++-- pattern Head x <- x : xs++single (Single x) = x+hd :: [a] -> a+hd (Head x) = x++--++{-+data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x+-}++h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x
+ test/tests/ImportPattern.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/ImportPattern.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,150 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ImportPattern (+  useP,+  collectArgs,+  isInt,+  isIntEndo,+  arrows,+  viewPL,+  viewPR,+  fac,+  showable,+  one,+  f,+  g,+  two,+  single,+  hd,+  h ) where++import Control.Monad (guard)+import qualified Data.Sequence as Seq++import Imported.ExportPattern++-- pattern P = 42++useP P = 43++--++{-+data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]++-}++collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow++--+{-++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)+-}++viewPL (x :< Empty) = x+viewPR (Empty :> y) = y++--++{-+pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1+-}++fac (Succ n) = Succ n * fac n+fac 0 = 1++--++{-+data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x+-}++showable :: (Show a) => a -> Showable+showable x = MkShowable x++--++{-+-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+-}++one One = 2++--+++--pattern Pair x y <- [x, y]+++f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+++--+{-+data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+-}++two = S ( S Z)++--++-- pattern Single x = [x]++-- pattern Head x <- x : xs++single (Single x) = x+hd :: [a] -> a+hd (Head x) = x++--++{-+data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x+-}++h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x
+ test/tests/ImportPattern.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,149 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module ImportPattern where++import Control.Monad ()+import qualified Data.Sequence as Seq ()+import Imported.ExportPattern+    ( T,+      Nat(Z, S),+      Showable(..),+      Type,+      pattern ExNumPat,+      pattern Head,+      pattern Single,+      pattern Pair,+      pattern One,+      pattern Succ,+      pattern (:>),+      pattern (:<),+      pattern Empty,+      pattern Int,+      pattern Arrow,+      pattern P )++-- pattern P = 42++useP P = 43++--++{-+data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]++-}++collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow++--+{-++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)+-}++viewPL (x :< Empty) = x+viewPR (Empty :> y) = y++--++{-+pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1+-}++fac (Succ n) = Succ n * fac n+fac 0 = 1++--++{-+data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x+-}++showable :: (Show a) => a -> Showable+showable x = MkShowable x++--++{-+-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+-}++one One = 2++--+++--pattern Pair x y <- [x, y]+++f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+++--+{-+data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+-}++two = S ( S Z)++--++-- pattern Single x = [x]++-- pattern Head x <- x : xs++single (Single x) = x+hd :: [a] -> a+hd (Head x) = x++--++{-+data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x+-}++h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x
+ test/tests/Imported/ExportPattern.hs view
@@ -0,0 +1,141 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ViewPatterns #-}++module Imported.ExportPattern where++import Control.Monad (guard)+import qualified Data.Sequence as Seq++pattern P = 42++--useP P = 43++--++data Type = App String [Type]++pattern Arrow :: Type -> Type -> Type+pattern Arrow t1 t2 = App "->" [t1, t2]++pattern Int = App "Int" []++pattern Maybe t = App "Maybe" [t]+++{-+collectArgs :: Type -> [Type]+collectArgs (Arrow t1 t2) = t1 : collectArgs t2+collectArgs _ = []++isInt :: Type -> Bool+isInt Int = True+isInt _ = False++isIntEndo :: Type -> Bool+isIntEndo (Arrow Int Int) = True+isIntEndo _ = False++arrows :: [Type] -> Type -> Type+arrows = flip $ foldr Arrow+-}++--+++pattern Empty <- (Seq.viewl -> Seq.EmptyL)+pattern x :< xs <- (Seq.viewl -> x Seq.:< xs)+pattern xs :> x <- (Seq.viewr -> xs Seq.:> x)++{-+viewPL (x :< Empty) = x+viewPR (Empty :> y) = y+-}++--+++pattern Succ n <-+  (\x -> (x -1) <$ guard (x > 0) -> Just n)+  where+    Succ n = n + 1++{-+fac (Succ n) = Succ n * fac n+fac 0 = 1+-}++--+++data Showable where+  MkShowable :: (Show a) => a -> Showable++-- Required context is empty, but provided context is not+pattern Sh :: () => (Show a) => a -> Showable+pattern Sh x <- MkShowable x++{-+showable :: (Show a) => a -> Showable+showable x = MkShowable x+-}++--+++-- Provided context is empty+pattern One :: (Num a, Eq a) => a+pattern One <- 1+++-- one One = 2++--+++pattern Pair x y <- [x, y]++++{-+f (Pair True True) = True+f _ = False++g [True, True] = True+g _ = False+-}++++--++data Nat = Z | S Nat deriving (Show)++pattern Ess p = S p+++--two = S ( S Z)++--++pattern Single x = [x]++pattern Head x <- x : xs++{- single (Single x) = x+hd :: [a] -> a+hd (Head x) = x+-}++--+++data T a where+  MkT :: (Show b) => a -> b -> T a++pattern ExNumPat x = MkT 42 x++{-+h :: (Num t, Eq t) => T t -> String+h (ExNumPat x) = show x+-}
+ test/tests/Imported/TypeFam.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module Imported.TypeFam where++import qualified Data.ByteString.Char8 as BS+import           Data.ByteString (ByteString)+import           Data.Monoid ((<>))+import qualified Data.Text as T+import           Data.Text (Text)++class Concat a b where+  type ConcatTy a b -- the declared type will replace this type synonym+  cat :: a -> b -> ConcatTy a b++instance Concat Text String where+  type ConcatTy Text String = Text+  cat x y = x <> (T.pack y)++instance Concat String Text where+  type ConcatTy String Text = Text+  cat x y = (T.pack x) <> y++instance Concat String ByteString where+  type ConcatTy String ByteString = String+  cat x y = x ++ (BS.unpack y)+  
+ test/tests/MoreExports.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/MoreExports.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,26 @@+module MoreExports (+  H(..),+  R(..),+  D(..),+  N(..),+  foo,+  main ) where++--Another comment+--++newtype N a = Int a++data D a = A a  | B | C a++data R = R { a :: Int, b :: Bool }++data H = I | J | K deriving Show+++foo = (+1)++-- A further  Comment++main :: IO ()+main = print J
+ test/tests/MoreExports.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,26 @@+module MoreExports (+  H(..),+  R(..),+  D(..),+  N(..),+  foo,+  main ) where++--Another comment+--++newtype N a = Int a++data D a = A a  | B | C a++data R = R { a :: Int, b :: Bool }++data H = I | J | K deriving Show+++foo = (+1)++-- A further  Comment++main :: IO ()+main = print J
+ test/tests/MoreExports.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/MoreExports.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,26 @@+module MoreExports (+  H(..),+  R(..),+  D(..),+  N(..),+  foo,+  main ) where++--Another comment+--++newtype N a = Int a++data D a = A a  | B | C a++data R = R { a :: Int, b :: Bool }++data H = I | J | K deriving Show+++foo = (+1)++-- A further  Comment++main :: IO ()+main = print J
+ test/tests/MoreExports.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/MultilineUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.MultilineUnused where++import Data.Bool ( bool )++foo = bool
+ test/tests/MultilineUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.MultilineUnused (+  foo ) where++import Data.Bool ( bool )++foo = bool
+ test/tests/MultilineUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,11 @@+module Test.MultilineUnused (+  foo ) where++import Data.Bool (bool)+import Data.List (break, cycle, drop, dropWhile, filter, genericDrop, genericLength,+                  genericReplicate, genericSplitAt, genericTake, group, inits, intercalate,+                  intersperse, isPrefixOf, iterate, map, permutations, repeat, replicate, reverse,+                  scanl, scanr, sort, sortBy, sortOn, splitAt, subsequences, tails, take, takeWhile,+                  transpose, unfoldr, unzip, unzip3, zip, zip3, zipWith, (++))++foo = bool
+ test/tests/MultilineUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/MultilineUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,11 @@+module Test.MultilineUnused (+  foo ) where++import Data.Bool (bool)+import Data.List (break, cycle, drop, dropWhile, filter, genericDrop, genericLength,+                  genericReplicate, genericSplitAt, genericTake, group, inits, intercalate,+                  intersperse, isPrefixOf, iterate, map, permutations, repeat, replicate, reverse,+                  scanl, scanr, sort, sortBy, sortOn, splitAt, subsequences, tails, take, takeWhile,+                  transpose, unfoldr, unzip, unzip3, zip, zip3, zipWith, (++))++foo = bool
+ test/tests/MultilineUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,6 @@+module Test.MultilineUnused where++import Data.Bool ( bool )+import Data.List ()++foo = bool
+ test/tests/Operator.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Operator.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,9 @@+module Operator (+  ($+$) ) where++infixl 5 $+$++($+$) :: [a] -> [a] -> [a]+[] $+$ d = d+d $+$ [] = d+d $+$ d' = d ++ d'
+ test/tests/Operator.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,9 @@+module Operator (+  ($+$) ) where++infixl 5 $+$++($+$) :: [a] -> [a] -> [a]+[] $+$ d = d+d $+$ [] = d+d $+$ d' = d ++ d'
+ test/tests/Operator.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Operator.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,9 @@+module Operator (+  ($+$) ) where++infixl 5 $+$++($+$) :: [a] -> [a] -> [a]+[] $+$ d = d+d $+$ [] = d+d $+$ d' = d ++ d'
+ test/tests/Operator.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Pattern.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,10 @@+{-# LANGUAGE PatternSynonyms #-}+module Pattern where++import qualified Data.List.NonEmpty as List1 ( cycle )+import Data.List.NonEmpty ( NonEmpty((:|)) )+++test = List1.cycle (1 :| [2,3])++test2 = 1 :| [2,3,1,2,3]
+ test/tests/Pattern.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,12 @@+{-# LANGUAGE PatternSynonyms #-}+module Pattern (+  test,+  test2 ) where++import qualified Data.List.NonEmpty as List1 ( cycle )+import Data.List.NonEmpty ( NonEmpty((:|)) )+++test = List1.cycle (1 :| [2,3])++test2 = 1 :| [2,3,1,2,3]
+ test/tests/Pattern.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,12 @@+{-# LANGUAGE PatternSynonyms #-}+module Pattern (+  test,+  test2 ) where++import qualified Data.List.NonEmpty as List1+import Data.List.NonEmpty (NonEmpty, pattern (:|), (<|))+++test = List1.cycle (1 :| [2,3])++test2 = 1 :| [2,3,1,2,3]
+ test/tests/Pattern.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/Pattern.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,12 @@+{-# LANGUAGE PatternSynonyms #-}+module Pattern (+  test,+  test2 ) where++import qualified Data.List.NonEmpty as List1+import Data.List.NonEmpty (NonEmpty, pattern (:|), (<|))+++test = List1.cycle (1 :| [2,3])++test2 = 1 :| [2,3,1,2,3]
+ test/tests/Pattern.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,10 @@+{-# LANGUAGE PatternSynonyms #-}+module Pattern where++import qualified Data.List.NonEmpty as List1 ( cycle )+import Data.List.NonEmpty ( NonEmpty((:|)) )+++test = List1.cycle (1 :| [2,3])++test2 = 1 :| [2,3,1,2,3]
+ test/tests/QualUnqual.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,6 @@+module QualUnqual where++import qualified Data.Char as C ( isDigit )+import Data.Char ( isDigit )++test x = C.isDigit x || isDigit x
+ test/tests/QualUnqual.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,7 @@+module QualUnqual (+  test ) where++import qualified Data.Char as C ( isDigit )+import Data.Char ( isDigit )++test x = C.isDigit x || isDigit x
+ test/tests/QualUnqual.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,7 @@+module QualUnqual (+  test ) where++import qualified Data.Char as C (isDigit, isLetter)+import Data.Char (isDigit, isLetter)++test x = C.isDigit x || isDigit x
+ test/tests/QualUnqual.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/QualUnqual.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,7 @@+module QualUnqual (+  test ) where++import qualified Data.Char as C (isDigit, isLetter)+import Data.Char (isDigit, isLetter)++test x = C.isDigit x || isDigit x
+ test/tests/QualUnqual.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,6 @@+module QualUnqual where++import qualified Data.Char as C ( isDigit )+import Data.Char ( isDigit )++test x = C.isDigit x || isDigit x
+ test/tests/TypeConstructorUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.TypeConstructorUnused where++true = True
+ test/tests/TypeConstructorUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.TypeConstructorUnused (+  true ) where++true = True
+ test/tests/TypeConstructorUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUnused (+  true ) where++import Data.Bool (Bool (False, True))++true = True
+ test/tests/TypeConstructorUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeConstructorUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUnused (+  true ) where++import Data.Bool (Bool (False, True))++true = True
+ test/tests/TypeConstructorUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.TypeConstructorUnused where++import Data.Bool ()++true = True
+ test/tests/TypeConstructorUnusedComma.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.TypeConstructorUnusedComma where++false = False
+ test/tests/TypeConstructorUnusedComma.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.TypeConstructorUnusedComma (+  false ) where++false = False
+ test/tests/TypeConstructorUnusedComma.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUnusedComma (+  false ) where++import Data.Bool (Bool (False, True))++false = False
+ test/tests/TypeConstructorUnusedComma.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeConstructorUnusedComma.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUnusedComma (+  false ) where++import Data.Bool (Bool (False, True))++false = False
+ test/tests/TypeConstructorUnusedComma.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.TypeConstructorUnusedComma where++import Data.Bool ()++false = False
+ test/tests/TypeConstructorUsed.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.TypeConstructorUsed where++true = True
+ test/tests/TypeConstructorUsed.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.TypeConstructorUsed (+  true ) where++true = True
+ test/tests/TypeConstructorUsed.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUsed (+  true ) where++import Data.Bool (Bool (True))++true = True
+ test/tests/TypeConstructorUsed.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeConstructorUsed.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeConstructorUsed (+  true ) where++import Data.Bool (Bool (True))++true = True
+ test/tests/TypeConstructorUsed.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.TypeConstructorUsed where++import Data.Bool ()++true = True
+ test/tests/TypeFam.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,43 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module TypeFam where++import Data.Text ( Text )+import Imported.TypeFam ( Concat(cat, type ConcatTy) )+++result :: ConcatTy Text String+result =  cat ("Hello" :: Text) (" World!" :: String)++main = print result++class Container c where+  type Elem c+  empty  :: c+  insert :: Elem c -> c -> c+  member :: Elem c -> c -> Bool+  toList :: c -> [Elem c]++instance Eq e => Container [e] where+  type Elem [e]   = e+  empty           = []+  insert e l      = (e:l)+  member e []     = False+  member e (x:xs)+    | e == x      = True+    | otherwise   = member e xs+  toList l        = l++instance Eq e => Container (Maybe e) where+  type Elem (Maybe e) = e -- type synonym+  empty            = Nothing+  insert e l       = Just e -- destructive, replaces previous element+  member e Nothing = False+  member e (Just x) = e == x+  toList Nothing   = []+  toList (Just x)  = [x]
+ test/tests/TypeFam.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,46 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module TypeFam (+  Container(..),+  result,+  main ) where++import Data.Text ( Text )+import Imported.TypeFam ( Concat(cat, type ConcatTy) )+++result :: ConcatTy Text String+result =  cat ("Hello" :: Text) (" World!" :: String)++main = print result++class Container c where+  type Elem c+  empty  :: c+  insert :: Elem c -> c -> c+  member :: Elem c -> c -> Bool+  toList :: c -> [Elem c]++instance Eq e => Container [e] where+  type Elem [e]   = e+  empty           = []+  insert e l      = (e:l)+  member e []     = False+  member e (x:xs)+    | e == x      = True+    | otherwise   = member e xs+  toList l        = l++instance Eq e => Container (Maybe e) where+  type Elem (Maybe e) = e -- type synonym+  empty            = Nothing+  insert e l       = Just e -- destructive, replaces previous element+  member e Nothing = False+  member e (Just x) = e == x+  toList Nothing   = []+  toList (Just x)  = [x]
+ test/tests/TypeFam.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,51 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module TypeFam (+  Container(..),+  result,+  main ) where++import qualified Data.ByteString.Char8 as BS+import           Data.ByteString (ByteString)+import           Data.Monoid ((<>))+import qualified Data.Text as T+import           Data.Text (Text)++import Imported.TypeFam+++result :: ConcatTy Text String+result =  cat ("Hello" :: Text) (" World!" :: String)++main = print result++class Container c where+  type Elem c+  empty  :: c+  insert :: Elem c -> c -> c+  member :: Elem c -> c -> Bool+  toList :: c -> [Elem c]++instance Eq e => Container [e] where+  type Elem [e]   = e+  empty           = []+  insert e l      = (e:l)+  member e []     = False+  member e (x:xs)+    | e == x      = True+    | otherwise   = member e xs+  toList l        = l++instance Eq e => Container (Maybe e) where+  type Elem (Maybe e) = e -- type synonym+  empty            = Nothing+  insert e l       = Just e -- destructive, replaces previous element+  member e Nothing = False+  member e (Just x) = e == x+  toList Nothing   = []+  toList (Just x)  = [x]
+ test/tests/TypeFam.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeFam.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,51 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module TypeFam (+  Container(..),+  result,+  main ) where++import qualified Data.ByteString.Char8 as BS+import           Data.ByteString (ByteString)+import           Data.Monoid ((<>))+import qualified Data.Text as T+import           Data.Text (Text)++import Imported.TypeFam+++result :: ConcatTy Text String+result =  cat ("Hello" :: Text) (" World!" :: String)++main = print result++class Container c where+  type Elem c+  empty  :: c+  insert :: Elem c -> c -> c+  member :: Elem c -> c -> Bool+  toList :: c -> [Elem c]++instance Eq e => Container [e] where+  type Elem [e]   = e+  empty           = []+  insert e l      = (e:l)+  member e []     = False+  member e (x:xs)+    | e == x      = True+    | otherwise   = member e xs+  toList l        = l++instance Eq e => Container (Maybe e) where+  type Elem (Maybe e) = e -- type synonym+  empty            = Nothing+  insert e l       = Just e -- destructive, replaces previous element+  member e Nothing = False+  member e (Just x) = e == x+  toList Nothing   = []+  toList (Just x)  = [x]
+ test/tests/TypeFam.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,47 @@+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings     #-}+{-# LANGUAGE TypeFamilies          #-}++-- http://www.mchaver.com/posts/2017-06-21-type-families.html++module TypeFam where++import qualified Data.ByteString.Char8 as BS ()+import Data.ByteString ()+import Data.Monoid ()+import qualified Data.Text as T ()+import Data.Text ( Text )+import Imported.TypeFam ( Concat(cat, type ConcatTy) )+++result :: ConcatTy Text String+result =  cat ("Hello" :: Text) (" World!" :: String)++main = print result++class Container c where+  type Elem c+  empty  :: c+  insert :: Elem c -> c -> c+  member :: Elem c -> c -> Bool+  toList :: c -> [Elem c]++instance Eq e => Container [e] where+  type Elem [e]   = e+  empty           = []+  insert e l      = (e:l)+  member e []     = False+  member e (x:xs)+    | e == x      = True+    | otherwise   = member e xs+  toList l        = l++instance Eq e => Container (Maybe e) where+  type Elem (Maybe e) = e -- type synonym+  empty            = Nothing+  insert e l       = Just e -- destructive, replaces previous element+  member e Nothing = False+  member e (Just x) = e == x+  toList Nothing   = []+  toList (Just x)  = [x]
+ test/tests/TypeUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.TypeUnused where++foo = not
+ test/tests/TypeUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.TypeUnused (+  foo ) where++foo = not
+ test/tests/TypeUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeUnused (+  foo ) where++import Data.Bool (Bool, not)++foo = not
+ test/tests/TypeUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.TypeUnused (+  foo ) where++import Data.Bool (Bool, not)++foo = not
+ test/tests/TypeUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.TypeUnused where++import Data.Bool ()++foo = not
+ test/tests/TypeUsed.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,4 @@+module Test.TypeUsed where++foo :: Bool+foo = undefined
+ test/tests/TypeUsed.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,5 @@+module Test.TypeUsed (+  foo ) where++foo :: Bool+foo = undefined
+ test/tests/TypeUsed.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,7 @@+module Test.TypeUsed (+  foo ) where++import Data.Bool (Bool, not)++foo :: Bool+foo = undefined
+ test/tests/TypeUsed.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/TypeUsed.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,7 @@+module Test.TypeUsed (+  foo ) where++import Data.Bool (Bool, not)++foo :: Bool+foo = undefined
+ test/tests/TypeUsed.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,6 @@+module Test.TypeUsed where++import Data.Bool ()++foo :: Bool+foo = undefined
+ test/tests/WildcardUnused.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.WildcardUnused where++foo = not
+ test/tests/WildcardUnused.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.WildcardUnused (+  foo ) where++foo = not
+ test/tests/WildcardUnused.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.WildcardUnused (+  foo ) where++import Data.Bool (Bool (..), not)++foo = not
+ test/tests/WildcardUnused.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/WildcardUnused.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.WildcardUnused (+  foo ) where++import Data.Bool (Bool (..), not)++foo = not
+ test/tests/WildcardUnused.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.WildcardUnused where++import Data.Bool ()++foo = not
+ test/tests/WildcardUsed.MinimiseImportsNoExportProcessing-golden view
@@ -0,0 +1,3 @@+module Test.WildcardUsed where++foo = False
+ test/tests/WildcardUsed.MinimiseImportsReplaceExports-golden view
@@ -0,0 +1,4 @@+module Test.WildcardUsed (+  foo ) where++foo = False
+ test/tests/WildcardUsed.NoImportProcessingAddExplicitExports-golden view
@@ -0,0 +1,6 @@+module Test.WildcardUsed (+  foo ) where++import Data.Bool (Bool (..))++foo = False
+ test/tests/WildcardUsed.NoImportProcessingNoExportProcessing-golden view
@@ -0,0 +1,1 @@+Source file was not touched
+ test/tests/WildcardUsed.NoImportProcessingReplaceExports-golden view
@@ -0,0 +1,6 @@+module Test.WildcardUsed (+  foo ) where++import Data.Bool (Bool (..))++foo = False
+ test/tests/WildcardUsed.PreserveInstanceImportsNoExportProcessing-golden view
@@ -0,0 +1,5 @@+module Test.WildcardUsed where++import Data.Bool ()++foo = False