Skip to content

Commit 975db49

Browse files
michaelpjjhrcek
andauthored
Use GHC2021 (#4033)
Co-authored-by: Jan Hrček <[email protected]>
1 parent a0baa4d commit 975db49

File tree

141 files changed

+252
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+252
-689
lines changed

Diff for: exe/Main.hs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
3-
{-# LANGUAGE LambdaCase #-}
4-
{-# LANGUAGE NamedFieldPuns #-}
5-
{-# LANGUAGE OverloadedStrings #-}
6-
{-# LANGUAGE ScopedTypeVariables #-}
3+
{-# LANGUAGE LambdaCase #-}
4+
{-# LANGUAGE OverloadedStrings #-}
75
module Main(main) where
86

97
import Control.Exception (displayException)

Diff for: exe/Wrapper.hs

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE DataKinds #-}
3-
{-# LANGUAGE ExplicitNamespaces #-}
4-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5-
{-# LANGUAGE LambdaCase #-}
6-
{-# LANGUAGE NamedFieldPuns #-}
7-
{-# LANGUAGE OverloadedStrings #-}
8-
{-# LANGUAGE RecordWildCards #-}
9-
{-# LANGUAGE ScopedTypeVariables #-}
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE DataKinds #-}
3+
{-# LANGUAGE LambdaCase #-}
4+
{-# LANGUAGE OverloadedStrings #-}
5+
{-# LANGUAGE RecordWildCards #-}
106
-- | This module is based on the hie-wrapper.sh script in
117
-- https://github.com/alanz/vscode-hie-server
128
module Main where

Diff for: ghcide-bench/ghcide-bench.cabal

+3-33
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source-repository head
1919
location: https://github.com/haskell/haskell-language-server.git
2020

2121
executable ghcide-bench
22-
default-language: Haskell2010
22+
default-language: GHC2021
2323
build-depends:
2424
aeson,
2525
base,
@@ -45,23 +45,13 @@ executable ghcide-bench
4545
ghc-options: -threaded -Wall -Wno-name-shadowing -rtsopts
4646
main-is: Main.hs
4747
default-extensions:
48-
BangPatterns
49-
DeriveFunctor
50-
DeriveGeneric
51-
FlexibleContexts
52-
GeneralizedNewtypeDeriving
5348
LambdaCase
54-
NamedFieldPuns
5549
OverloadedStrings
5650
RecordWildCards
57-
ScopedTypeVariables
58-
StandaloneDeriving
59-
TupleSections
60-
TypeApplications
6151
ViewPatterns
6252

6353
library
64-
default-language: Haskell2010
54+
default-language: GHC2021
6555
hs-source-dirs: src
6656
ghc-options: -Wall -Wno-name-shadowing
6757
exposed-modules:
@@ -91,23 +81,13 @@ library
9181
text,
9282
row-types
9383
default-extensions:
94-
BangPatterns
95-
DeriveFunctor
96-
DeriveGeneric
97-
FlexibleContexts
98-
GeneralizedNewtypeDeriving
9984
LambdaCase
100-
NamedFieldPuns
10185
RecordWildCards
102-
ScopedTypeVariables
103-
StandaloneDeriving
104-
TupleSections
105-
TypeApplications
10686
ViewPatterns
10787

10888
test-suite test
10989
type: exitcode-stdio-1.0
110-
default-language: Haskell2010
90+
default-language: GHC2021
11191
build-tool-depends:
11292
ghcide:ghcide,
11393
implicit-hie:gen-hie
@@ -124,17 +104,7 @@ test-suite test
124104
tasty-hunit >= 0.10,
125105
tasty-rerun,
126106
default-extensions:
127-
BangPatterns
128-
DeriveFunctor
129-
DeriveGeneric
130-
FlexibleContexts
131-
GeneralizedNewtypeDeriving
132107
LambdaCase
133-
NamedFieldPuns
134108
OverloadedStrings
135109
RecordWildCards
136-
ScopedTypeVariables
137-
StandaloneDeriving
138-
TupleSections
139-
TypeApplications
140110
ViewPatterns

Diff for: ghcide-bench/src/Experiments.hs

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
{-# LANGUAGE ConstraintKinds #-}
2-
{-# LANGUAGE DataKinds #-}
3-
{-# LANGUAGE ExistentialQuantification #-}
4-
{-# LANGUAGE GADTs #-}
5-
{-# LANGUAGE ImplicitParams #-}
6-
{-# LANGUAGE ImpredicativeTypes #-}
7-
{-# LANGUAGE OverloadedLabels #-}
8-
{-# LANGUAGE OverloadedStrings #-}
9-
{-# LANGUAGE PolyKinds #-}
1+
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE GADTs #-}
3+
{-# LANGUAGE ImplicitParams #-}
4+
{-# LANGUAGE ImpredicativeTypes #-}
5+
{-# LANGUAGE OverloadedLabels #-}
6+
{-# LANGUAGE OverloadedStrings #-}
107
{-# OPTIONS_GHC -Wno-deprecations -Wno-unticked-promoted-constructors #-}
118

129
module Experiments

Diff for: ghcide-bench/test/Main.hs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE DuplicateRecordFields #-}
88
{-# LANGUAGE GADTs #-}
99
{-# LANGUAGE ImplicitParams #-}
10-
{-# LANGUAGE PolyKinds #-}
1110
{-# OPTIONS_GHC -Wno-deprecations -Wno-unticked-promoted-constructors #-}
1211

1312
module Main (main) where

Diff for: ghcide/ghcide.cabal

+5-38
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ common warnings
4747
-fno-ignore-asserts
4848

4949
library
50-
default-language: Haskell2010
50+
default-language: GHC2021
5151
build-depends:
5252
, aeson
5353
, array
@@ -123,24 +123,11 @@ library
123123
build-depends: unix
124124

125125
default-extensions:
126-
BangPatterns
127126
DataKinds
128-
DeriveFoldable
129-
DeriveFunctor
130-
DeriveGeneric
131-
DeriveTraversable
132-
FlexibleContexts
133-
GeneralizedNewtypeDeriving
134-
KindSignatures
127+
ExplicitNamespaces
135128
LambdaCase
136-
NamedFieldPuns
137129
OverloadedStrings
138130
RecordWildCards
139-
ScopedTypeVariables
140-
StandaloneDeriving
141-
TupleSections
142-
TypeApplications
143-
TypeOperators
144131
ViewPatterns
145132

146133
hs-source-dirs: src session-loader
@@ -249,7 +236,7 @@ flag test-exe
249236

250237
executable ghcide-test-preprocessor
251238
import: warnings
252-
default-language: Haskell2010
239+
default-language: GHC2021
253240
hs-source-dirs: test/preprocessor
254241
ghc-options: -Wno-name-shadowing
255242
main-is: Main.hs
@@ -264,7 +251,7 @@ flag executable
264251

265252
executable ghcide
266253
import: warnings
267-
default-language: Haskell2010
254+
default-language: GHC2021
268255
hs-source-dirs: exe
269256
ghc-options: -threaded -rtsopts "-with-rtsopts=-I0 -A128M -T" -Wno-name-shadowing
270257

@@ -291,19 +278,9 @@ executable ghcide
291278

292279
autogen-modules: Paths_ghcide
293280
default-extensions:
294-
BangPatterns
295-
DeriveFunctor
296-
DeriveGeneric
297-
FlexibleContexts
298-
GeneralizedNewtypeDeriving
299281
LambdaCase
300-
NamedFieldPuns
301282
OverloadedStrings
302283
RecordWildCards
303-
ScopedTypeVariables
304-
StandaloneDeriving
305-
TupleSections
306-
TypeApplications
307284
ViewPatterns
308285

309286
if !flag(executable)
@@ -319,7 +296,7 @@ executable ghcide
319296
test-suite ghcide-tests
320297
import: warnings
321298
type: exitcode-stdio-1.0
322-
default-language: Haskell2010
299+
default-language: GHC2021
323300
build-tool-depends:
324301
, ghcide:ghcide
325302
, ghcide:ghcide-test-preprocessor
@@ -420,17 +397,7 @@ test-suite ghcide-tests
420397

421398
-- Tests that have been pulled out of the main file
422399
default-extensions:
423-
BangPatterns
424-
DeriveFunctor
425-
DeriveGeneric
426-
FlexibleContexts
427-
GeneralizedNewtypeDeriving
428400
LambdaCase
429-
NamedFieldPuns
430401
OverloadedStrings
431402
RecordWildCards
432-
ScopedTypeVariables
433-
StandaloneDeriving
434-
TupleSections
435-
TypeApplications
436403
ViewPatterns

Diff for: ghcide/session-loader/Development/IDE/Session.hs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE ExistentialQuantification #-}
3-
{-# LANGUAGE RankNTypes #-}
4-
{-# LANGUAGE TypeFamilies #-}
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE TypeFamilies #-}
53

64
{-|
75
The logic for setting up a ghcide session by tapping into hie-bios.

Diff for: ghcide/session-loader/Development/IDE/Session/Diagnostics.hs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE DeriveAnyClass #-}
2-
{-# LANGUAGE DeriveGeneric #-}
32

43
module Development.IDE.Session.Diagnostics where
54
import Control.Applicative

Diff for: ghcide/src/Development/IDE/Core/Actions.hs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE RankNTypes #-}
21
{-# LANGUAGE TypeFamilies #-}
32
module Development.IDE.Core.Actions
43
( getAtPoint

Diff for: ghcide/src/Development/IDE/Core/Compile.hs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
{-# LANGUAGE CPP #-}
55
{-# LANGUAGE GADTs #-}
6-
{-# LANGUAGE RankNTypes #-}
76

87
-- | Based on https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/API.
98
-- Given a list of paths to find libraries, and a file to compile, produce a list of 'CoreModule' values.

Diff for: ghcide/src/Development/IDE/Core/OfInterest.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
33

4-
{-# LANGUAGE FlexibleInstances #-}
5-
{-# LANGUAGE TypeFamilies #-}
4+
{-# LANGUAGE TypeFamilies #-}
65

76
-- | Utilities and state for the files of interest - those which are currently
87
-- open in the editor. The rule is 'IsFileOfInterest'

Diff for: ghcide/src/Development/IDE/Core/ProgressReporting.hs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE RankNTypes #-}
21
module Development.IDE.Core.ProgressReporting
32
( ProgressEvent(..)
43
, ProgressReporting(..)

Diff for: ghcide/src/Development/IDE/Core/RuleTypes.hs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
-- SPDX-License-Identifier: Apache-2.0
33

44
{-# LANGUAGE DerivingStrategies #-}
5-
{-# LANGUAGE FlexibleInstances #-}
65
{-# LANGUAGE GADTs #-}
76
{-# LANGUAGE PatternSynonyms #-}
87
{-# LANGUAGE TemplateHaskell #-}

Diff for: ghcide/src/Development/IDE/Core/Rules.hs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
{-# LANGUAGE CPP #-}
55
{-# LANGUAGE DuplicateRecordFields #-}
6-
{-# LANGUAGE FlexibleInstances #-}
76
{-# LANGUAGE TypeFamilies #-}
87

98
-- | A Shake implementation of the compiler service, built

Diff for: ghcide/src/Development/IDE/Core/Service.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
33

4-
{-# LANGUAGE FlexibleInstances #-}
5-
{-# LANGUAGE RankNTypes #-}
6-
{-# LANGUAGE TypeFamilies #-}
4+
{-# LANGUAGE TypeFamilies #-}
75

86
-- | A Shake implementation of the compiler service, built
97
-- using the "Shaker" abstraction layer for in-memory use.

Diff for: ghcide/src/Development/IDE/Core/Shake.hs

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
22
-- SPDX-License-Identifier: Apache-2.0
33

4-
{-# LANGUAGE CPP #-}
5-
{-# LANGUAGE ConstraintKinds #-}
6-
{-# LANGUAGE DerivingStrategies #-}
7-
{-# LANGUAGE DuplicateRecordFields #-}
8-
{-# LANGUAGE ExistentialQuantification #-}
9-
{-# LANGUAGE PackageImports #-}
10-
{-# LANGUAGE PolyKinds #-}
11-
{-# LANGUAGE RankNTypes #-}
12-
{-# LANGUAGE RecursiveDo #-}
13-
{-# LANGUAGE TypeFamilies #-}
4+
{-# LANGUAGE CPP #-}
5+
{-# LANGUAGE DerivingStrategies #-}
6+
{-# LANGUAGE DuplicateRecordFields #-}
7+
{-# LANGUAGE PackageImports #-}
8+
{-# LANGUAGE RecursiveDo #-}
9+
{-# LANGUAGE TypeFamilies #-}
1410

1511
-- | A Shake implementation of the compiler service.
1612
--

Diff for: ghcide/src/Development/IDE/Core/UseStale.hs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{-# LANGUAGE DerivingVia #-}
2-
{-# LANGUAGE GADTs #-}
3-
{-# LANGUAGE KindSignatures #-}
4-
{-# LANGUAGE RankNTypes #-}
1+
{-# LANGUAGE DerivingVia #-}
2+
{-# LANGUAGE GADTs #-}
53

64
module Development.IDE.Core.UseStale
75
( Age(..)

Diff for: ghcide/src/Development/IDE/GHC/Compat.hs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
-- SPDX-License-Identifier: Apache-2.0
33

44
{-# LANGUAGE CPP #-}
5-
{-# LANGUAGE ConstraintKinds #-}
6-
{-# LANGUAGE FlexibleInstances #-}
75
{-# LANGUAGE PatternSynonyms #-}
86

97
-- | Attempt at hiding the GHC version differences we can.

Diff for: ghcide/src/Development/IDE/GHC/Compat/CmdLine.hs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE RankNTypes #-}
32

43
-- | Compat module Interface file relevant code.
54
module Development.IDE.GHC.Compat.CmdLine (
@@ -15,12 +14,13 @@ module Development.IDE.GHC.Compat.CmdLine (
1514
) where
1615

1716
#if MIN_VERSION_ghc(9,3,0)
18-
import GHC.Driver.Session (processCmdLineP, CmdLineP (..), getCmdLineState, putCmdLineState)
19-
import GHC.Driver.CmdLine
17+
import GHC.Driver.CmdLine
18+
import GHC.Driver.Session (CmdLineP (..), getCmdLineState,
19+
processCmdLineP, putCmdLineState)
2020
#else
21-
import GHC.Driver.CmdLine
22-
import Control.Monad.IO.Class
23-
import GHC (Located)
21+
import Control.Monad.IO.Class
22+
import GHC (Located)
23+
import GHC.Driver.CmdLine
2424
#endif
2525

2626
#if !MIN_VERSION_ghc(9,3,0)

Diff for: ghcide/src/Development/IDE/GHC/Compat/Core.hs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE ConstraintKinds #-}
3-
{-# LANGUAGE FlexibleInstances #-}
42
{-# LANGUAGE PatternSynonyms #-}
53
{-# LANGUAGE ViewPatterns #-}
64

Diff for: ghcide/src/Development/IDE/GHC/Compat/Util.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE ConstraintKinds #-}
1+
{-# LANGUAGE CPP #-}
32
-- | GHC Utils and Datastructures re-exports.
43
--
54
-- Mainly handles module hierarchy re-organisation of GHC

Diff for: ghcide/src/Development/IDE/GHC/CoreFile.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE FlexibleInstances #-}
3-
{-# LANGUAGE RecordWildCards #-}
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE RecordWildCards #-}
43

54
-- | CoreFiles let us serialize Core to a file in order to later recover it
65
-- without reparsing or retypechecking

0 commit comments

Comments
 (0)