[Git][ghc/ghc][wip/romes/ast-ohne-faststring] 5 commits: ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jun 10 10:20:53 UTC 2024



Rodrigo Mesquita pushed to branch wip/romes/ast-ohne-faststring at Glasgow Haskell Compiler / GHC


Commits:
e5d1ee20 by Fabian Kirchner at 2024-06-10T12:20:00+02:00
ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var

Progress towards #21592

Specificity, ForAllTyFlag and its' helper functions are extracted from
GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity.

Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on
GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls.
At this point, this would cause cyclic dependencies.

- - - - -
e1c36eb6 by Fabian Kirchner at 2024-06-10T12:20:00+02:00
ttg: Move some AST types into Language.Haskell.Syntax.Basic

In particular, we move:
* TopLevelFlag
* TypeOrData
* TyConFlavour

Progress towards #21592

- - - - -
34732024 by Adowrath at 2024-06-10T12:20:00+02:00
ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type

Progress towards #21592

This splits HsSrcBang up, creating the new HsBang within
`Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness
and strictness information, while `HsSrcBang` only adds the SourceText
for usage within the compiler directly.

Inside the AST, to preserve the SourceText, it is hidden behind the
pre-existing extension point `XBindTy`. All other occurrences of
`HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when
interacting with the `BindTy` constructor, the hidden `SourceText` is
extracted/inserted into the `XBindTy` extension point.

`GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for
convenience. A constructor function `mkHsSrcBang` that takes all
individual components has been added.

Two exceptions has been made though:
- The `Outputable HsSrcBang` instance is replaced by
  `Outputable HsBang`. While being only GHC-internal, the only place
  it's used is in outputting `HsBangTy` constructors -- which already
  have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just
  to ignore the `SourceText` anyway.
- The error `TcRnUnexpectedAnnotation` did not use the `SourceText`,
  so it too now only holds a `HsBang`.

- - - - -
6c9268b2 by Mauricio at 2024-06-10T12:20:00+02:00
AST: Moved definitions that use GHC.Utils.Panic to GHC namespace

Progress towards #21592

- - - - -
373fc016 by Rodrigo Mesquita at 2024-06-10T12:20:43+02:00
ttg: Start using Text over FastString in the AST

Towards the goal of making the AST independent of GHC, this commit
starts the task of replacing usages of `FastString` with `Text` in the
AST (Language.Haskell.* modules).

Even though we /do/ want to use FastStrings -- critically in Names or Ids
-- there is no particular reason for the FastStrings that occur in the
AST proper to be FastStrings. Primarily, ...

Progress towards #21592

- - - - -


30 changed files:

- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/TyCo/Rep.hs-boot
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/StringBuffer.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Types/Var.hs-boot
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/124aa9ef78819760905056e92f70b761f84d8e10...373fc01607be18425f3f3cd2b690d72c41efd297

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/124aa9ef78819760905056e92f70b761f84d8e10...373fc01607be18425f3f3cd2b690d72c41efd297
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/20240610/139b86ce/attachment-0001.html>


More information about the ghc-commits mailing list