Skip to content

Commit

Permalink
ghc-lib-parser 9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
amesgen committed May 4, 2024
1 parent 6079787 commit 9265f67
Show file tree
Hide file tree
Showing 55 changed files with 583 additions and 429 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: [ghc947, ghc963, ghc981]
ghc: [ghc965, ghc982]
name: Build and test on ${{ matrix.ghc }}
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Unreleased

* Switched to `ghc-lib-parser-9.10`, with the following new syntactic features/behaviors:
* GHC proposal [#575](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0575-deprecated-instances.rst): deprecated instances.
* GHC proposal [#281](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0281-visible-forall.rst): visible forall in types of terms.
Enabled by `RequiredTypeArguments` (enabled by default).
* `LinearTypes`: `let` and `where` bindings can now be linear, in particular have multiplicity annotations.
* Using `forall` as an identifier is now a parse error.
* 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.
* `TypeAbstractions` now supports `@`-binders in lambdas and function equations.
* Support for the `GHC2024` language.

* Updated to `Cabal-syntax-3.12`.

## Ormolu 0.7.4.0

* Don't error when the `JavaScriptFFI` language pragma is present. [Issue
Expand Down
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
packages: . extract-hackage-info

constraints: ormolu +dev

source-repository-package
type: git
location: https://github.com/amesgen/stuff
tag: 20b6b9d136502ba442fde9e8e2903d29772fcfee
subdir: ghc-lib-parser-9.10.1-rc
--sha256: sha256-s6QUeNV+spH9gR2xhu+Lg2EiI8viGqmIkKnSGZVwILI=
6 changes: 3 additions & 3 deletions data/examples/backpack/signature-0-out.hsig
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ instance Primitive Prim

name :: String

-- \| The name of the primitive used as the seed stretcher
-- \| Test line 2
-- | The name of the primitive used as the seed stretcher
-- | Test line 2
-- | Test line 3
-- \|Test line 4
-- |Test line 4
primName :: String

randomBlocks ::
Expand Down
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infix-out.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ infix 0 <?>
infix 9 <^-^>

infix 2 ->

infix 0 type <!>
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ infix 0 <?>
infix 9 <^-^>

infix 2 ->

infix 0 type <!>
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infixl-out.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
infixl 8 ***

infixl 0 $, *, +, &&, **

infixl 9 type $
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infixl.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
infixl 8 ***
infixl 0 $, *, +, &&, **

infixl 9 type $
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infixr-out.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
infixr 8 `Foo`

infixr 0 ***, &&&

infixr 0 data $
2 changes: 2 additions & 0 deletions data/examples/declaration/signature/fixity/infixr.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
infixr 8 `Foo`
infixr 0 ***, &&&

infixr 0 data $
2 changes: 1 addition & 1 deletion data/examples/declaration/value/function/pragmas-out.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sccfoo = {-# SCC foo #-} 1
sccfoo = {-# SCC "foo" #-} 1

sccbar =
{-# SCC "barbaz" #-}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
vshow :: forall a -> (Show a) => a -> String
vshow t x = show (x :: t)

s1 = vshow Int 42

s2 = vshow Double 42

a1 = f (type (Int -> Bool))

a2 = f (type ((Read T) => T))

a3 = f (type (forall a. a))

a4 = f (type (forall a. (Read a) => String -> a))

foo =
f
( type ( Maybe
Int
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
vshow :: forall a -> Show a => a -> String
vshow t x = show (x :: t)

s1 = vshow Int 42
s2 = vshow Double 42

a1 = f (type (Int -> Bool))
a2 = f (type (Read T => T))
a3 = f (type (forall a. a))
a4 = f (type (forall a. Read a => String -> a))

foo = f (type (Maybe
Int))
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
id :: forall a. a -> a
id @t x = x :: t

f1 :: forall a. a -> forall b. b -> (a, b)
f1 @a x @b y = (x :: a, y :: b)

f2 =
(\ @a x @b y -> (x :: a, y :: b)) ::
forall a. a -> forall b. b -> (a, b)
8 changes: 8 additions & 0 deletions data/examples/declaration/value/function/type-abstractions.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id :: forall a. a -> a
id @t x = x :: t

f1 :: forall a. a -> forall b. b -> (a, b)
f1 @a x @b y = (x :: a, y :: b)

f2 = (\ @a x @b y -> (x :: a, y :: b) )
:: forall a. a -> forall b. b -> (a, b)
9 changes: 9 additions & 0 deletions data/examples/declaration/warning/warning-multiline-out.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
#-}
test :: IO ()
test = pure ()

instance
{-# WARNING "Don't use" #-}
Show G1 where
show = "G1"

deriving instance
{-# WARNING "to be removed" #-}
Eq G2
8 changes: 8 additions & 0 deletions data/examples/declaration/warning/warning-multiline.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
foo ["These are bad functions", "Really bad!"] #-}
test :: IO ()
test = pure ()

instance
{-# WARNING "Don't use" #-}
Show G1 where
show = "G1"

deriving instance
{-# WARNING "to be removed" #-} Eq G2
12 changes: 10 additions & 2 deletions data/examples/declaration/warning/warning-single-line-out.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ test = pure ()
bar = 3
{-# DEPRECATED bar "Bar is deprecated" #-}

{-# DEPRECATED baz "Baz is also deprecated" #-}
{-# DEPRECATED data baz "Baz is also deprecated" #-}
baz = 5

data Number = Number Dobule
{-# DEPRECATED Number "Use Scientific instead." #-}
{-# DEPRECATED type Number "Use Scientific instead." #-}

head (a : _) = a
{-# WARNING in "x-partial" head "This function is partial..." #-}

instance {-# DEPRECATED "Don't use" #-} Show T1

instance {-# WARNING "Don't use either" #-} Show G1

deriving instance {-# DEPRECATED "to be removed" #-} Eq T2

deriving instance {-# WARNING "to be removed as well" #-} Eq G2
10 changes: 8 additions & 2 deletions data/examples/declaration/warning/warning-single-line.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ bar = 3

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

{-# DEPRECATED baz "Baz is also deprecated" #-}
{-# DEPRECATED data baz "Baz is also deprecated" #-}
baz = 5

data Number = Number Dobule
{-# DEPRECATED Number "Use Scientific instead." #-}
{-# DEPRECATED type Number "Use Scientific instead." #-}

head (a:_) = a
{-# WARNING in "x-partial" head "This function is partial..." #-}

instance {-# DEPRECATED "Don't use" #-} Show T1 where
instance {-# WARNING "Don't use either" #-} Show G1 where

deriving instance {-# DEPRECATED "to be removed" #-} Eq T2
deriving instance {-# WARNING "to be removed as well" #-} Eq G2
12 changes: 12 additions & 0 deletions data/examples/import/docstrings-after-exports-out.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Test
( since1, -- ^ @since 1.0
since2, -- ^ @since 2.0
since3, -- ^ @since 3.0
SinceType (..), -- ^ @since 4.0
SinceClass (..), -- ^ @since 5.0
Multi (..),
-- ^ since 6.0
-- multi
-- line
)
where
11 changes: 11 additions & 0 deletions data/examples/import/docstrings-after-exports.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Test (
since1, -- ^ @since 1.0
since2 -- ^ @since 2.0
, since3 -- ^ @since 3.0
, SinceType(..) -- ^ @since 4.0
, SinceClass(..) -- ^ @since 5.0
, Multi(..)
-- ^ since 6.0
-- multi
-- line
) where
48 changes: 0 additions & 48 deletions expected-failures/Agda.txt

This file was deleted.

3 changes: 0 additions & 3 deletions expected-failures/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
let
inherit (pkgs) lib;
expectedFailures = [
"Agda"
"brittany"
"esqueleto"
"hlint"
"leksah"
"lens"
"pandoc"
"pipes"
"postgrest"
"purescript"
];
ormolizedPackages =
let
Expand Down
2 changes: 1 addition & 1 deletion expected-failures/hlint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ src/Extension.hs
Formatting is not idempotent.
Please, consider reporting the bug.
src/Hint/Bracket.hs
@@ -258,8 +258,11 @@
@@ -265,8 +265,11 @@
let y = noLocA $ HsApp EpAnnNotUsed a1 (nlHsPar a2),
let r = Replace Expr (toSSA e) [("a", toSSA a1), ("b", toSSA a2)] "a (b)"
]
Expand Down
16 changes: 0 additions & 16 deletions expected-failures/leksah.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,3 @@ src/IDE/Find.hs:615:36-46
The GHC parser (in Haddock mode) failed:
[GHC-95644] Bang pattern in expression context: !matchIndex
Did you mean to add a space after the '!'?
src/IDE/Pane/Modules.hs
@@ -1183,9 +1183,9 @@
let modId = mdModuleId modDescr
modName = modu modId
mFilePath = mdMbSourcePath modDescr
- -- show relative file path for Main modules
+ in -- show relative file path for Main modules
-- since we can have several
- in case (components modName, mFilePath) of
+ case (components modName, mFilePath) of
(["Main"], Just fp) ->
let sfp = case (pdMbSourcePath (snd pair)) of
Nothing -> fp

Formatting is not idempotent.
Please, consider reporting the bug.
28 changes: 0 additions & 28 deletions expected-failures/pandoc.txt

This file was deleted.

Loading

0 comments on commit 9265f67

Please sign in to comment.