Skip to content

Commit d32ea25

Browse files
committed
Use GHC2021
1 parent f0f77d6 commit d32ea25

39 files changed

Lines changed: 86 additions & 109 deletions

.ghci

Lines changed: 0 additions & 1 deletion
This file was deleted.

hpack.cabal

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ source-repository head
2525
library
2626
hs-source-dirs:
2727
src
28+
default-extensions: BangPatterns ConstrainedClassMethods DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveTraversable ExistentialQuantification ExplicitForAll FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving KindSignatures MultiParamTypeClasses NamedFieldPuns PostfixOperators RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeOperators TypeSynonymInstances DeriveAnyClass DerivingStrategies LambdaCase OverloadedStrings RecordWildCards ViewPatterns DefaultSignatures
2829
ghc-options: -Wall
2930
build-depends:
3031
Cabal >=3.0.0.0 && <3.6
@@ -49,6 +50,24 @@ library
4950
, unordered-containers
5051
, vector
5152
, yaml >=0.10.0
53+
if impl(ghc >= 8.10)
54+
default-extensions: ImportQualifiedPost StandaloneKindSignatures
55+
if impl(ghc >= 8.6)
56+
default-extensions: NumericUnderscores
57+
if impl(ghc >= 8.4)
58+
default-extensions: EmptyDataDeriving HexFloatLiterals
59+
if impl(ghc >= 8.0)
60+
default-extensions: DeriveLift TypeApplications
61+
if impl(ghc >= 7.10)
62+
default-extensions: BinaryLiterals NamedWildCards
63+
if impl(ghc >= 7.8)
64+
default-extensions: EmptyCase
65+
if impl(ghc >= 7.6)
66+
default-extensions: InstanceSigs
67+
if impl(ghc >= 7.4)
68+
default-extensions: ConstraintKinds PolyKinds
69+
if impl(ghc >= 7.2)
70+
default-extensions: DeriveGeneric GADTSyntax
5271
exposed-modules:
5372
Hpack
5473
Hpack.Config
@@ -83,6 +102,7 @@ executable hpack
83102
main-is: Main.hs
84103
hs-source-dirs:
85104
driver
105+
default-extensions: BangPatterns ConstrainedClassMethods DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveTraversable ExistentialQuantification ExplicitForAll FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving KindSignatures MultiParamTypeClasses NamedFieldPuns PostfixOperators RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeOperators TypeSynonymInstances DeriveAnyClass DerivingStrategies LambdaCase OverloadedStrings RecordWildCards ViewPatterns DefaultSignatures
86106
ghc-options: -Wall
87107
build-depends:
88108
Cabal >=3.0.0.0 && <3.6
@@ -108,6 +128,24 @@ executable hpack
108128
, unordered-containers
109129
, vector
110130
, yaml >=0.10.0
131+
if impl(ghc >= 8.10)
132+
default-extensions: ImportQualifiedPost StandaloneKindSignatures
133+
if impl(ghc >= 8.6)
134+
default-extensions: NumericUnderscores
135+
if impl(ghc >= 8.4)
136+
default-extensions: EmptyDataDeriving HexFloatLiterals
137+
if impl(ghc >= 8.0)
138+
default-extensions: DeriveLift TypeApplications
139+
if impl(ghc >= 7.10)
140+
default-extensions: BinaryLiterals NamedWildCards
141+
if impl(ghc >= 7.8)
142+
default-extensions: EmptyCase
143+
if impl(ghc >= 7.6)
144+
default-extensions: InstanceSigs
145+
if impl(ghc >= 7.4)
146+
default-extensions: ConstraintKinds PolyKinds
147+
if impl(ghc >= 7.2)
148+
default-extensions: DeriveGeneric GADTSyntax
111149
other-modules:
112150
Paths_hpack
113151
default-language: Haskell2010
@@ -118,6 +156,7 @@ test-suite spec
118156
hs-source-dirs:
119157
test
120158
src
159+
default-extensions: BangPatterns ConstrainedClassMethods DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveTraversable ExistentialQuantification ExplicitForAll FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving KindSignatures MultiParamTypeClasses NamedFieldPuns PostfixOperators RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeOperators TypeSynonymInstances DeriveAnyClass DerivingStrategies LambdaCase OverloadedStrings RecordWildCards ViewPatterns DefaultSignatures QuasiQuotes
121160
ghc-options: -Wall
122161
cpp-options: -DTEST
123162
build-depends:
@@ -150,6 +189,24 @@ test-suite spec
150189
, unordered-containers
151190
, vector
152191
, yaml >=0.10.0
192+
if impl(ghc >= 8.10)
193+
default-extensions: ImportQualifiedPost StandaloneKindSignatures
194+
if impl(ghc >= 8.6)
195+
default-extensions: NumericUnderscores
196+
if impl(ghc >= 8.4)
197+
default-extensions: EmptyDataDeriving HexFloatLiterals
198+
if impl(ghc >= 8.0)
199+
default-extensions: DeriveLift TypeApplications
200+
if impl(ghc >= 7.10)
201+
default-extensions: BinaryLiterals NamedWildCards
202+
if impl(ghc >= 7.8)
203+
default-extensions: EmptyCase
204+
if impl(ghc >= 7.6)
205+
default-extensions: InstanceSigs
206+
if impl(ghc >= 7.4)
207+
default-extensions: ConstraintKinds PolyKinds
208+
if impl(ghc >= 7.2)
209+
default-extensions: DeriveGeneric GADTSyntax
153210
build-tool-depends:
154211
hspec-discover:hspec-discover
155212
other-modules:

package.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ extra-source-files:
1010

1111
ghc-options: -Wall
1212

13+
defaults: sol/ghc2021@v0.1.0
14+
15+
default-extensions:
16+
- DeriveAnyClass
17+
- DerivingStrategies
18+
- LambdaCase
19+
- OverloadedStrings
20+
- RecordWildCards
21+
- ViewPatterns
22+
- DefaultSignatures
23+
1324
dependencies:
1425
- base >= 4.9 && < 5
1526
- bytestring
@@ -64,3 +75,5 @@ tests:
6475
- template-haskell
6576
- HUnit >= 1.6.0.0
6677
build-tools: hspec-discover
78+
default-extensions:
79+
- QuasiQuotes

src/Data/Aeson/Config/FromValue.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
{-# LANGUAGE DefaultSignatures #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE FlexibleInstances #-}
4-
{-# LANGUAGE ScopedTypeVariables #-}
51
{-# LANGUAGE TypeFamilies #-}
62
{-# LANGUAGE TypeOperators #-}
7-
{-# LANGUAGE StandaloneDeriving #-}
8-
{-# LANGUAGE RecordWildCards #-}
93

10-
{-# LANGUAGE ConstraintKinds #-}
114
module Data.Aeson.Config.FromValue (
125
FromValue(..)
136
, Parser

src/Data/Aeson/Config/Parser.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2-
{-# LANGUAGE ViewPatterns #-}
3-
{-# LANGUAGE OverloadedStrings #-}
41
{-# LANGUAGE CPP #-}
52
module Data.Aeson.Config.Parser (
63
Parser
@@ -65,7 +62,7 @@ fromAesonPathElement e = case e of
6562
Aeson.Index n -> Index n
6663

6764
newtype Parser a = Parser {unParser :: WriterT (Set JSONPath) Aeson.Parser a}
68-
deriving (Functor, Applicative, Alternative, Monad, Fail.MonadFail)
65+
deriving newtype (Functor, Applicative, Alternative, Monad, Fail.MonadFail)
6966

7067
liftParser :: Aeson.Parser a -> Parser a
7168
liftParser = Parser . lift

src/Data/Aeson/Config/Types.hs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
{-# LANGUAGE DeriveFunctor #-}
2-
{-# LANGUAGE DeriveFoldable #-}
3-
{-# LANGUAGE DeriveTraversable #-}
4-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
51
module Data.Aeson.Config.Types where
62

73
import Data.Semigroup (Semigroup(..))
@@ -12,7 +8,8 @@ import Data.Bifunctor
128
import Data.Aeson.Config.FromValue
139

1410
newtype List a = List {fromList :: [a]}
15-
deriving (Eq, Show, Functor, Foldable, Traversable, Semigroup, Monoid)
11+
deriving newtype (Eq, Show, Functor, Foldable, Semigroup, Monoid)
12+
deriving (Traversable)
1613

1714
instance FromValue a => FromValue (List a) where
1815
fromValue v = List <$> case v of

src/Hpack.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE ViewPatterns #-}
3-
{-# LANGUAGE RecordWildCards #-}
42
module Hpack (
53
-- | /__NOTE:__/ This module is exposed to allow integration of Hpack into
64
-- other tools. It is not meant for general use by end users. The following

src/Hpack/CabalFile.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
{-# LANGUAGE LambdaCase #-}
2-
{-# LANGUAGE RecordWildCards #-}
3-
{-# LANGUAGE ViewPatterns #-}
41
module Hpack.CabalFile where
52

63
import Control.Monad

src/Hpack/Config.hs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE DeriveFunctor #-}
3-
{-# LANGUAGE DeriveFoldable #-}
4-
{-# LANGUAGE DeriveTraversable #-}
5-
{-# LANGUAGE DeriveAnyClass #-}
6-
{-# LANGUAGE FlexibleInstances #-}
7-
{-# LANGUAGE LambdaCase #-}
8-
{-# LANGUAGE LiberalTypeSynonyms #-}
9-
{-# LANGUAGE OverloadedStrings #-}
10-
{-# LANGUAGE RecordWildCards #-}
111
{-# LANGUAGE CPP #-}
12-
{-# LANGUAGE ScopedTypeVariables #-}
13-
{-# LANGUAGE ViewPatterns #-}
14-
{-# LANGUAGE RankNTypes #-}
15-
{-# LANGUAGE FlexibleContexts #-}
162
module Hpack.Config (
173
-- | /__NOTE:__/ This module is exposed to allow integration of Hpack into
184
-- other tools. It is not meant for general use by end users. The following
@@ -469,7 +455,8 @@ hasKey _ _ = False
469455

470456
newtype Condition = Condition {
471457
conditionCondition :: Cond
472-
} deriving (Eq, Show, Generic, FromValue)
458+
} deriving (Eq, Show, Generic)
459+
deriving anyclass FromValue
473460

474461
data Cond = CondBool Bool | CondExpression String
475462
deriving (Eq, Show)

src/Hpack/Defaults.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{-# LANGUAGE OverloadedStrings #-}
21
{-# LANGUAGE CPP #-}
3-
{-# LANGUAGE RecordWildCards #-}
4-
{-# LANGUAGE ViewPatterns #-}
5-
{-# LANGUAGE LambdaCase #-}
62
module Hpack.Defaults (
73
ensure
84
, Defaults(..)

0 commit comments

Comments
 (0)