[Git][ghc/ghc][wip/structured-ghci-errors] 6 commits: Print exception metadata in default handler
Jade (@Jade)
gitlab at gitlab.haskell.org
Mon Aug 5 18:57:44 UTC 2024
Jade pushed to branch wip/structured-ghci-errors at Glasgow Haskell Compiler / GHC
Commits:
ff158fcd by Tommy Bidne at 2024-08-02T01:14:32+12:00
Print exception metadata in default handler
CLC proposals 231 and 261:
- Add exception type metadata to SomeException's displayException.
- Add "Exception" header to default exception handler.
See:
https://github.com/haskell/core-libraries-committee/issues/231
https://github.com/haskell/core-libraries-committee/issues/261
Update stm submodule for test fixes.
- - - - -
8b2f70a2 by Andrei Borzenkov at 2024-08-01T23:00:46-04:00
Type syntax in expressions (#24159, #24572, #24226)
This patch extends the grammar of expressions with syntax that is
typically found only in types:
* function types (a -> b), (a ->. b), (a %m -> b)
* constrained types (ctx => t)
* forall-quantification (forall tvs. t)
The new forms are guarded behind the RequiredTypeArguments extension,
as specified in GHC Proposal #281. Examples:
{-# LANGUAGE RequiredTypeArguments #-}
e1 = f (Int -> String) -- function type
e2 = f (Int %1 -> String) -- linear function type
e3 = f (forall a. Bounded a => a) -- forall type, constraint
The GHC AST and the TH AST have been extended as follows:
syntax | HsExpr | TH.Exp
---------------+----------+--------------
a -> b | HsFunArr | ConE (->)
a %m -> b | HsFunArr | ConE FUN
ctx => t | HsQual | ConstrainedE
forall a. t | HsForAll | ForallE
forall a -> t | HsForAll | ForallVisE
Additionally, a new warning flag -Wview-pattern-signatures has been
introduced to aid with migration to the new precedence of (e -> p :: t).
Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com>
- - - - -
66e7f57d by Brandon Chinn at 2024-08-01T21:50:58-07:00
Implement MultilineStrings (#24390)
This commit adds support for multiline strings, proposed at
https://github.com/ghc-proposals/ghc-proposals/pull/569.
Multiline strings can now be written as:
myString =
"""
this is a
multiline string
"""
The multiline string will have leading indentation stripped away.
Full details of this post-processing may be found at the new
GHC.Parser.String module.
In order to cleanly implement this and maximize reusability, I
broke out the lexing logic for strings out of Lexer.x into a
new GHC.Parser.String module, which lexes strings with any
provided "get next character" function. This also gave us the
opportunity to clean up this logic, and even optimize it a bit.
With this change, parsing string literals now takes 25% less
time and 25% less space.
- - - - -
cf47b96f by Rodrigo Mesquita at 2024-08-03T05:59:40-04:00
hi: Stable sort avails
Sorting the Avails in DocStructures is required to produce fully
deterministic interface files in presence of re-exported modules.
Fixes #25104
- - - - -
a143bdc2 by sheaf at 2024-08-05T20:55:16+02:00
Generalise GHC diagnostic code infrastructure
This commit generalises the infrastructure used for diagnostic codes,
allowing it to be used for other namespaces than the GHC namespace.
In particular, this enables GHCi to re-use the same infrastructure to
emit error messages.
- - - - -
bf7be15d by Jade at 2024-08-05T20:57:04+02:00
Add structural errors to GHCi (#23338)
This patch creates the 'GhciCommandErrorMessage' data type which
implents the 'Diagnostic' class and also provides error code for these
error conditions.
- - - - -
30 changed files:
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Ppr.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/CharClass.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1a8a3010e562c5fd715ff1d7e4fdd278a05b4f1...bf7be15dcc8a3ce2f4126d4a17864746363265aa
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1a8a3010e562c5fd715ff1d7e4fdd278a05b4f1...bf7be15dcc8a3ce2f4126d4a17864746363265aa
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240805/aa587de9/attachment.html>
More information about the ghc-commits
mailing list