Skip to content

Commit ed1c321

Browse files
committed
ghc-lib-parser 9.10
1 parent 6079787 commit ed1c321

Some content is hidden

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

56 files changed

+622
-428
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
ghc: [ghc947, ghc963, ghc981]
15+
ghc: [ghc965, ghc982, ghc910X]
1616
name: Build and test on ${{ matrix.ghc }}
1717
runs-on: ubuntu-latest
1818
steps:

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## Unreleased
2+
3+
* Switched to `ghc-lib-parser-9.10`, with the following new syntactic features/behaviors:
4+
* GHC proposal [#575](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0575-deprecated-instances.rst): deprecated instances.
5+
* GHC proposal [#281](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0281-visible-forall.rst): visible forall in types of terms.
6+
Enabled by `RequiredTypeArguments` (enabled by default).
7+
* `LinearTypes`: `let` and `where` bindings can now be linear, in particular have multiplicity annotations.
8+
* Using `forall` as an identifier is now a parse error.
9+
* GHC proposal [#65](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0065-type-infix.rst): namespacing fixity declarations for type names and WARNING/DEPRECATED pragmas.
10+
* `TypeAbstractions` now supports `@`-binders in lambdas and function equations.
11+
* Support for the `GHC2024` language.
12+
13+
* Updated to `Cabal-syntax-3.12`.
14+
115
## Ormolu 0.7.4.0
216

317
* Don't error when the `JavaScriptFFI` language pragma is present. [Issue

cabal.project

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
packages: . extract-hackage-info
22

33
constraints: ormolu +dev
4+
5+
source-repository-package
6+
type: git
7+
location: https://github.com/amesgen/stuff
8+
tag: cfa55f0e8ea243d3561c008ca4aec16584234e60
9+
subdir: ghc-lib-parser-9.10.1.20240510
10+
--sha256: sha256-VMczYxa8MVwBJIff8/VkDWWXCoZCr+HOY9Va1Gwf8Eg=
11+
12+
if impl(ghc >=9.10)
13+
allow-newer: base, template-haskell, ghc-prim, path-io:filepath
14+
constraints: unix installed
15+
16+
source-repository-package
17+
type: git
18+
location: https://github.com/haskell-hvr/text-short
19+
tag: 0f929568d97aea2237b64f7c5b3c3836fa109eb1
20+
--sha256: sha256-GVoCir2XYVUebNM155lrqgvUsKuAQcydPCoutlRSlvE=

data/examples/backpack/signature-0-out.hsig

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ instance Primitive Prim
1515

1616
name :: String
1717

18-
-- \| The name of the primitive used as the seed stretcher
19-
-- \| Test line 2
18+
-- | The name of the primitive used as the seed stretcher
19+
-- | Test line 2
2020
-- | Test line 3
21-
-- \|Test line 4
21+
-- |Test line 4
2222
primName :: String
2323

2424
randomBlocks ::

data/examples/declaration/signature/fixity/infix-out.hs

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ infix 0 <?>
33
infix 9 <^-^>
44

55
infix 2 ->
6+
7+
infix 0 type <!>

data/examples/declaration/signature/fixity/infix.hs

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ infix 0 <?>
22
infix 9 <^-^>
33

44
infix 2 ->
5+
6+
infix 0 type <!>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
infixl 8 ***
22

33
infixl 0 $, *, +, &&, **
4+
5+
infixl 9 type $
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
infixl 8 ***
22
infixl 0 $, *, +, &&, **
3+
4+
infixl 9 type $
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
infixr 8 `Foo`
22

33
infixr 0 ***, &&&
4+
5+
infixr 0 data $
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
infixr 8 `Foo`
22
infixr 0 ***, &&&
3+
4+
infixr 0 data $

data/examples/declaration/value/function/pragmas-out.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sccfoo = {-# SCC foo #-} 1
1+
sccfoo = {-# SCC "foo" #-} 1
22

33
sccbar =
44
{-# SCC "barbaz" #-}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vshow :: forall a -> (Show a) => a -> String
2+
vshow t x = show (x :: t)
3+
4+
s1 = vshow Int 42
5+
6+
s2 = vshow Double 42
7+
8+
a1 = f (type (Int -> Bool))
9+
10+
a2 = f (type ((Read T) => T))
11+
12+
a3 = f (type (forall a. a))
13+
14+
a4 = f (type (forall a. (Read a) => String -> a))
15+
16+
foo =
17+
f
18+
( type ( Maybe
19+
Int
20+
)
21+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vshow :: forall a -> Show a => a -> String
2+
vshow t x = show (x :: t)
3+
4+
s1 = vshow Int 42
5+
s2 = vshow Double 42
6+
7+
a1 = f (type (Int -> Bool))
8+
a2 = f (type (Read T => T))
9+
a3 = f (type (forall a. a))
10+
a4 = f (type (forall a. Read a => String -> a))
11+
12+
foo = f (type (Maybe
13+
Int))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id :: forall a. a -> a
2+
id @t x = x :: t
3+
4+
f1 :: forall a. a -> forall b. b -> (a, b)
5+
f1 @a x @b y = (x :: a, y :: b)
6+
7+
f2 =
8+
(\ @a x @b y -> (x :: a, y :: b)) ::
9+
forall a. a -> forall b. b -> (a, b)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
id :: forall a. a -> a
2+
id @t x = x :: t
3+
4+
f1 :: forall a. a -> forall b. b -> (a, b)
5+
f1 @a x @b y = (x :: a, y :: b)
6+
7+
f2 = (\ @a x @b y -> (x :: a, y :: b) )
8+
:: forall a. a -> forall b. b -> (a, b)

data/examples/declaration/warning/warning-multiline-out.hs

+9
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@
77
#-}
88
test :: IO ()
99
test = pure ()
10+
11+
instance
12+
{-# WARNING "Don't use" #-}
13+
Show G1 where
14+
show = "G1"
15+
16+
deriving instance
17+
{-# WARNING "to be removed" #-}
18+
Eq G2

data/examples/declaration/warning/warning-multiline.hs

+8
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@
22
foo ["These are bad functions", "Really bad!"] #-}
33
test :: IO ()
44
test = pure ()
5+
6+
instance
7+
{-# WARNING "Don't use" #-}
8+
Show G1 where
9+
show = "G1"
10+
11+
deriving instance
12+
{-# WARNING "to be removed" #-} Eq G2

data/examples/declaration/warning/warning-single-line-out.hs

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ test = pure ()
66
bar = 3
77
{-# DEPRECATED bar "Bar is deprecated" #-}
88

9-
{-# DEPRECATED baz "Baz is also deprecated" #-}
9+
{-# DEPRECATED data baz "Baz is also deprecated" #-}
1010
baz = 5
1111

1212
data Number = Number Dobule
13-
{-# DEPRECATED Number "Use Scientific instead." #-}
13+
{-# DEPRECATED type Number "Use Scientific instead." #-}
1414

1515
head (a : _) = a
1616
{-# WARNING in "x-partial" head "This function is partial..." #-}
17+
18+
instance {-# DEPRECATED "Don't use" #-} Show T1
19+
20+
instance {-# WARNING "Don't use either" #-} Show G1
21+
22+
deriving instance {-# DEPRECATED "to be removed" #-} Eq T2
23+
24+
deriving instance {-# WARNING "to be removed as well" #-} Eq G2

data/examples/declaration/warning/warning-single-line.hs

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ bar = 3
88

99
{-# Deprecated bar "Bar is deprecated" #-}
1010

11-
{-# DEPRECATED baz "Baz is also deprecated" #-}
11+
{-# DEPRECATED data baz "Baz is also deprecated" #-}
1212
baz = 5
1313

1414
data Number = Number Dobule
15-
{-# DEPRECATED Number "Use Scientific instead." #-}
15+
{-# DEPRECATED type Number "Use Scientific instead." #-}
1616

1717
head (a:_) = a
1818
{-# WARNING in "x-partial" head "This function is partial..." #-}
19+
20+
instance {-# DEPRECATED "Don't use" #-} Show T1 where
21+
instance {-# WARNING "Don't use either" #-} Show G1 where
22+
23+
deriving instance {-# DEPRECATED "to be removed" #-} Eq T2
24+
deriving instance {-# WARNING "to be removed as well" #-} Eq G2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module Test
2+
( since1, -- ^ @since 1.0
3+
since2, -- ^ @since 2.0
4+
since3, -- ^ @since 3.0
5+
SinceType (..), -- ^ @since 4.0
6+
SinceClass (..), -- ^ @since 5.0
7+
Multi (..),
8+
-- ^ since 6.0
9+
-- multi
10+
-- line
11+
)
12+
where
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Test (
2+
since1, -- ^ @since 1.0
3+
since2 -- ^ @since 2.0
4+
, since3 -- ^ @since 3.0
5+
, SinceType(..) -- ^ @since 4.0
6+
, SinceClass(..) -- ^ @since 5.0
7+
, Multi(..)
8+
-- ^ since 6.0
9+
-- multi
10+
-- line
11+
) where

expected-failures/Agda.txt

-48
This file was deleted.

expected-failures/default.nix

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
let
44
inherit (pkgs) lib;
55
expectedFailures = [
6-
"Agda"
76
"brittany"
87
"esqueleto"
98
"hlint"
@@ -12,7 +11,6 @@ let
1211
"pandoc"
1312
"pipes"
1413
"postgrest"
15-
"purescript"
1614
];
1715
ormolizedPackages =
1816
let

expected-failures/hlint.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ src/Extension.hs
1313
Formatting is not idempotent.
1414
Please, consider reporting the bug.
1515
src/Hint/Bracket.hs
16-
@@ -258,8 +258,11 @@
16+
@@ -265,8 +265,11 @@
1717
let y = noLocA $ HsApp EpAnnNotUsed a1 (nlHsPar a2),
1818
let r = Replace Expr (toSSA e) [("a", toSSA a1), ("b", toSSA a2)] "a (b)"
1919
]

expected-failures/leksah.txt

-16
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,3 @@ src/IDE/Find.hs:615:36-46
22
The GHC parser (in Haddock mode) failed:
33
[GHC-95644] Bang pattern in expression context: !matchIndex
44
Did you mean to add a space after the '!'?
5-
src/IDE/Pane/Modules.hs
6-
@@ -1183,9 +1183,9 @@
7-
let modId = mdModuleId modDescr
8-
modName = modu modId
9-
mFilePath = mdMbSourcePath modDescr
10-
- -- show relative file path for Main modules
11-
+ in -- show relative file path for Main modules
12-
-- since we can have several
13-
- in case (components modName, mFilePath) of
14-
+ case (components modName, mFilePath) of
15-
(["Main"], Just fp) ->
16-
let sfp = case (pdMbSourcePath (snd pair)) of
17-
Nothing -> fp
18-
19-
Formatting is not idempotent.
20-
Please, consider reporting the bug.

expected-failures/pandoc.txt

-14
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,3 @@ src/Text/Pandoc/Readers/Org/Inlines.hs
1212

1313
Formatting is not idempotent.
1414
Please, consider reporting the bug.
15-
src/Text/Pandoc/Readers/RST.hs
16-
@@ -1125,7 +1125,7 @@
17-
-- if no ":class:" field is given, the default is the role name
18-
classFieldClasses = maybe [role] T.words (lookup "class" fields)
19-
- -- nub in case role name & language class are the same
20-
- in nub (classFieldClasses ++ codeLanguageClass ++ oldClasses)
21-
+ in -- nub in case role name & language class are the same
22-
+ nub (classFieldClasses ++ codeLanguageClass ++ oldClasses)
23-
24-
attr =
25-
let (ident, baseClasses, keyValues) = baseAttr
26-
27-
Formatting is not idempotent.
28-
Please, consider reporting the bug.

0 commit comments

Comments
 (0)