Skip to content

Commit e14ce68

Browse files
committed
Remove CPP and re-enable fourmolu where appropriate
1 parent a7b032d commit e14ce68

File tree

19 files changed

+244
-265
lines changed

19 files changed

+244
-265
lines changed

Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE GADTs #-}
43
{-# LANGUAGE TypeOperators #-}

Cabal-syntax/src/Distribution/Compat/Graph.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE DeriveDataTypeable #-}
43
{-# LANGUAGE FlexibleContexts #-}
54
{-# LANGUAGE ScopedTypeVariables #-}

Cabal-syntax/src/Distribution/Compat/Newtype.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE DefaultSignatures #-}
32
{-# LANGUAGE FlexibleInstances #-}
43
{-# LANGUAGE FunctionalDependencies #-}
@@ -32,7 +31,6 @@ import Data.Monoid (Endo (..), Product (..), Sum (..))
3231
-- Another approach would be to use @TypeFamilies@ (and possibly
3332
-- compute inner type using "GHC.Generics"), but we think @FunctionalDependencies@
3433
-- version gives cleaner type signatures.
35-
{- FOURMOLU_DISABLE -}
3634
class Newtype o n | n -> o where
3735
pack :: o -> n
3836
default pack :: Coercible o n => o -> n
@@ -41,7 +39,6 @@ class Newtype o n | n -> o where
4139
unpack :: n -> o
4240
default unpack :: Coercible n o => n -> o
4341
unpack = coerce
44-
{- FOURMOLU_ENABLE -}
4542

4643
instance Newtype a (Identity a)
4744
instance Newtype a (Sum a)

Cabal-syntax/src/Distribution/Compat/Prelude.hs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE RankNTypes #-}
43
{-# LANGUAGE Trustworthy #-}
@@ -180,23 +179,25 @@ module Distribution.Compat.Prelude
180179
, traceShowM
181180
) where
182181

183-
-- We also could hide few partial function
184-
{- FOURMOLU_DISABLE -}
185-
import Prelude as BasePrelude hiding
186-
( mapM, mapM_, sequence, any, all, head, tail, last, init
187-
-- partial functions
188-
, read
189-
, foldr1, foldl1
190-
-- As of base 4.11.0.0 Prelude exports part of Semigroup(..).
191-
-- Hide this so we instead rely on Distribution.Compat.Semigroup.
192-
, Semigroup(..)
193-
, Word
194-
-- We hide them, as we import only some members
195-
, Traversable, traverse, sequenceA
196-
, Foldable(..)
197-
)
198-
{- FOURMOLU_ENABLE -}
199182
import Data.Foldable as BasePrelude (elem, foldl, maximum, minimum, product, sum)
183+
import Prelude as BasePrelude hiding
184+
( Foldable (..)
185+
, Semigroup (..)
186+
, Traversable
187+
, Word
188+
, all
189+
, any
190+
, head
191+
, init
192+
, last
193+
, mapM
194+
, mapM_
195+
, read
196+
, sequence
197+
, sequenceA
198+
, tail
199+
, traverse
200+
)
200201

201202
-- AMP
202203
import Data.Foldable

Cabal-syntax/src/Distribution/Fields/ParseResult.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE FlexibleContexts #-}
43
{-# LANGUAGE RankNTypes #-}
54

Cabal-syntax/src/Distribution/Parsec.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE FlexibleContexts #-}
43
{-# LANGUAGE GADTs #-}
54
{-# LANGUAGE RankNTypes #-}

Cabal-syntax/src/Distribution/System.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE DeriveDataTypeable #-}
32
{-# LANGUAGE DeriveGeneric #-}
43
{-# LANGUAGE FlexibleContexts #-}

Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
module UnitTests.Distribution.Utils.CharSet where
32

43
import Prelude hiding (Foldable(..))

Cabal/src/Distribution/Compat/Async.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE DeriveDataTypeable #-}
32

43
-- | 'Async', yet using 'MVar's.
@@ -146,13 +145,11 @@ data AsyncCancelled = AsyncCancelled
146145
, Typeable
147146
)
148147

149-
{- FOURMOLU_DISABLE -}
150148
instance Exception AsyncCancelled where
151149
-- wraps in SomeAsyncException
152150
-- See https://github.com/ghc/ghc/commit/756a970eacbb6a19230ee3ba57e24999e4157b09
153151
fromException = asyncExceptionFromException
154152
toException = asyncExceptionToException
155-
{- FOURMOLU_ENABLE -}
156153

157154
-- | Cancel an asynchronous action
158155
--

Cabal/src/Distribution/Compat/ResponseFile.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE RankNTypes #-}
43

0 commit comments

Comments
 (0)