Skip to content

Commit 2cf896f

Browse files
committed
Use explicit imports
1 parent 615be6e commit 2cf896f

9 files changed

Lines changed: 98 additions & 34 deletions

File tree

src/Test/Mutagen/Lazy.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ module Test.Mutagen.Lazy
1010
)
1111
where
1212

13-
import Data.IORef
14-
-- For providing some default Lazy instances
15-
13+
import Data.IORef (IORef, modifyIORef', newIORef, readIORef)
1614
import Data.Map (Map)
1715
import qualified Data.Map as Map
18-
import Data.Word
19-
import System.IO.Unsafe
16+
import Data.Word (Word16, Word32, Word64, Word8)
17+
import System.IO.Unsafe (unsafePerformIO)
2018
import Test.Mutagen.Mutation (Pos)
2119

2220
{-------------------------------------------------------------------------------

src/Test/Mutagen/Mutant.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module Test.Mutagen.Mutant
1010
)
1111
where
1212

13-
import Control.Monad
14-
import Data.Typeable
15-
import Test.Mutagen.Fragment
16-
import Test.QuickCheck
13+
import Control.Monad (replicateM)
14+
import Data.Typeable (Typeable)
15+
import Test.Mutagen.Fragment (FragmentStore)
16+
import Test.QuickCheck (Gen, generate, resize)
1717

1818
{-------------------------------------------------------------------------------
1919
-- * Abstract test case mutants

src/Test/Mutagen/Mutation.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@ module Test.Mutagen.Mutation
2626
)
2727
where
2828

29-
-- For providing some default Mutable instances
30-
import Data.Char
29+
import Data.Char (chr)
3130
import qualified Data.List as List
3231
import Data.Map (Map)
3332
import qualified Data.Map as Map
34-
import Data.Tree
35-
import Data.Typeable
36-
import Data.Word
37-
import Test.Mutagen.Fragment
38-
import Test.Mutagen.Mutant
39-
import Test.QuickCheck
33+
import Data.Tree (Tree (..), levels)
34+
import Data.Typeable (Typeable)
35+
import Data.Word (Word16, Word32, Word64, Word8)
36+
import Test.Mutagen.Fragment (sampleFragments)
37+
import Test.Mutagen.Mutant (Mutant (..))
38+
import Test.QuickCheck (Arbitrary (..), arbitrary)
4039

4140
{-------------------------------------------------------------------------------
4241
-- * Mutable types

src/Test/Mutagen/Property.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ module Test.Mutagen.Property
2828
)
2929
where
3030

31-
import Data.Typeable
32-
import System.Timeout
31+
import Data.Typeable (Typeable, cast)
32+
import System.Timeout (timeout)
3333
import Test.Mutagen.Exception (AnException, discard, isDiscard, tryEvaluateIO)
34-
import Test.Mutagen.Fragment
35-
import Test.Mutagen.Lazy
36-
import Test.Mutagen.Mutation
34+
import Test.Mutagen.Fragment (Fragmentable (..))
35+
import Test.Mutagen.Lazy (Lazy (..))
36+
import Test.Mutagen.Mutation (Mutable (..))
3737
import Test.QuickCheck (Arbitrary, Gen, arbitrary)
38-
import Unsafe.Coerce
38+
import Unsafe.Coerce (unsafeCoerce)
3939

4040
{-------------------------------------------------------------------------------
4141
-- * Property arguments

src/Test/Mutagen/Report.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Test.Mutagen.Report
66
)
77
where
88

9-
import Test.Mutagen.Property
9+
import Test.Mutagen.Property (Args)
1010

1111
{-------------------------------------------------------------------------------
1212
-- * Testing reports

src/Test/Mutagen/Test/Loop.hs

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE ConstraintKinds #-}
22
{-# LANGUAGE DataKinds #-}
33
{-# LANGUAGE GADTs #-}
4+
{-# LANGUAGE PatternSynonyms #-}
45
{-# LANGUAGE RankNTypes #-}
56
{-# LANGUAGE TypeApplications #-}
67

@@ -11,17 +12,29 @@ module Test.Mutagen.Test.Loop
1112
)
1213
where
1314

14-
import Control.Monad
15+
import Control.Monad (void, when)
1516
import Control.Monad.Extra (ifM)
1617
import Control.Monad.IO.Class (MonadIO (..))
1718
import Data.Function ((&))
1819
import System.Random (split)
1920
import Test.Mutagen.Config (DebugMode (..))
20-
import Test.Mutagen.Fragment
21-
import Test.Mutagen.Lazy
22-
import Test.Mutagen.Mutation
21+
import Test.Mutagen.Fragment (storeFragments)
22+
import Test.Mutagen.Lazy (Lazy (..), readPosRef, resetPosRef)
23+
import Test.Mutagen.Mutation (Pos)
2324
import Test.Mutagen.Property
25+
( Args
26+
, Result (..)
27+
, protectProp
28+
, resultException
29+
, resultExpect
30+
, unProp
31+
, pattern Discarded
32+
, pattern Failed
33+
, pattern Passed
34+
)
2435
import Test.Mutagen.Report
36+
( Report (..)
37+
)
2538
import Test.Mutagen.Test.Queue
2639
( MutationBatch (..)
2740
, MutationCandidate (..)
@@ -32,7 +45,37 @@ import Test.Mutagen.Test.Queue
3245
, nextMutation
3346
)
3447
import Test.Mutagen.Test.State
48+
( MutagenState (..)
49+
, computeSize
50+
, incMutantKindCounter
51+
, incNumBoring
52+
, incNumDiscarded
53+
, incNumGenerated
54+
, incNumInteresting
55+
, incNumMutatedFromDiscarded
56+
, incNumMutatedFromPassed
57+
, incNumPassed
58+
, incNumTestsSinceLastInteresting
59+
, incNumTraceLogResets
60+
, resetNumTestsSinceLastInteresting
61+
, setAutoResetAfter
62+
, setCurrentGenSize
63+
, setDiscardedQueue
64+
, setExpect
65+
, setNextSeed
66+
, setPassedQueue
67+
, setRandomMutations
68+
, timedOut
69+
, updateFragmentStore
70+
, updatePassedQueue
71+
)
3572
import Test.Mutagen.Test.Terminal
73+
( MonadTerminal (..)
74+
, pretty
75+
, printBatchStatus
76+
, printGlobalStats
77+
, printShortStats
78+
)
3679
import Test.Mutagen.Tracer.Store (STraceType (..), TraceStoreImpl (..))
3780
import Test.Mutagen.Tracer.Trace (Trace (..), truncateTrace, withTrace)
3881
import Test.QuickCheck.Gen (unGen)

src/Test/Mutagen/Tracer/Plugin.hs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,31 @@ module Test.Mutagen.Tracer.Plugin
2929
)
3030
where
3131

32-
import Control.Monad
32+
import Control.Monad ((>=>))
3333
import Control.Monad.Writer (MonadIO, WriterT, lift, runWriterT, tell)
3434
import Data.Generics (Data, everywhereM, listify, mkM)
35-
import Data.IORef
35+
import Data.IORef (IORef, atomicModifyIORef', newIORef)
3636
import GHC.Hs
37+
( AnnDecl (..)
38+
, AnnProvenance (..)
39+
, GRHS (..)
40+
, GhcPs
41+
, HsExpr (..)
42+
, HsLit (..)
43+
, HsMatchContext (..)
44+
, HsModule (..)
45+
, HsParsedModule (..)
46+
, LHsExpr
47+
, Match (..)
48+
, gHsPar
49+
, getLocA
50+
, noExtField
51+
, noLocA
52+
, simpleImportDecl
53+
)
3754
import GHC.Plugins hiding ((<>))
3855
import GHC.Types.Name.Occurrence as Name
39-
import GHC.Types.SourceText
56+
import GHC.Types.SourceText (mkIntegralLit)
4057
import System.IO.Unsafe (unsafePerformIO)
4158
import Test.Mutagen.Tracer.Metadata
4259
( ModuleMetadata (..)
@@ -46,7 +63,7 @@ import Test.Mutagen.Tracer.Metadata
4663
, mkSingleModuleTracerMetadata
4764
, saveTracerMetadata
4865
)
49-
import Test.Mutagen.Tracer.Trace
66+
import Test.Mutagen.Tracer.Trace (TraceNode)
5067

5168
{-------------------------------------------------------------------------------
5269
-- * GHC Plugin

src/Test/Mutagen/Tracer/Store/API.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Test.Mutagen.Tracer.Store.API
99
where
1010

1111
import Test.Mutagen.Tracer.Store.Types (TraceType)
12-
import Test.Mutagen.Tracer.Trace
12+
import Test.Mutagen.Tracer.Trace (Trace)
1313

1414
{-------------------------------------------------------------------------------
1515
-- * Generic trace store interface

test/re/RE/Types.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44

55
module RE.Types where
66

7-
import Data.String
7+
import Data.String (IsString (..))
88
import Test.Mutagen
9+
( Arbitrary (..)
10+
, Fragmentable
11+
, Lazy (..)
12+
, Mutable (..)
13+
, elements
14+
)
15+
import Test.Mutagen.Mutant (Mutant (..))
916
import qualified Test.Mutagen.TH as TH
1017

1118
-- | Regular expressions

0 commit comments

Comments
 (0)