[Git][ghc/ghc][wip/tc-lcl-env-refactor] 10 commits: Zonking monad transformers

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Wed May 17 08:10:11 UTC 2023



Matthew Pickering pushed to branch wip/tc-lcl-env-refactor at Glasgow Haskell Compiler / GHC


Commits:
06b5f71d by sheaf at 2023-05-17T09:00:48+01:00
Zonking monad transformers

  - Introduce two zonking monad transformers, ZonkT and ZonkBndrT.
    ZonkT is a reader monad transformer over ZonkEnv.
    ZonkBndrT m is the codensity monad over ZonkT m.

    ZonkBndrT is used for computations that accumulate binders
    in the ZonkEnv.

  - Split up the zonking functions relating purely to types into
    GHC.Tc.Zonk.Type.

    This should allow us to introduce a slimmed-down zonking monad,
    which doesn't wrap the full TcM but a much smaller monad.
    This opens up the possibility of refactoring ErrCtxt to use this
    smaller zonking monad.

  - Refactor the remaining zonking functions to work over the monads
    ZonkTcM = ZonkT TcM and ZonkBndrTcM = ZonkBndrT TcM.

- - - - -
e722f3e3 by Matthew Pickering at 2023-05-17T09:00:48+01:00
Use setSrcSpan rather than setLclEnv in solveForAll

TODO

Fixes #23390

- - - - -
b524595e by Matthew Pickering at 2023-05-17T09:06:03+01:00
Split up TcLclEnv from GHC.Tc.Types

By splitting up TcLclEnv from GHC.Tc.Types we allow GHC.Hs.Expr to no
longer depend on the TcM monad and all that entails.

* New modules for the LclEnv and all its basic parts
* CtLocEnv
* TcLclCtxt (setLclEnv vs restoreLclEnv)

- - - - -
0d0441e9 by Matthew Pickering at 2023-05-17T09:08:49+01:00
Integrate into zonking patch

- - - - -
c7ef7bc6 by Matthew Pickering at 2023-05-17T09:09:41+01:00
Remove dependency of GHC.Tc.Utils.TcType on GHC.Driver.Session

This removes the usage of DynFlags from Tc.Utils.TcType  so that it no
longer depends on GHC.Driver.Session. In general we don't want anything
which is a dependency of Language.Haskell.Syntax to depend on
GHC.Driver.Session and removing this edge gets us closer to that goal.

- - - - -
3ed792c7 by Matthew Pickering at 2023-05-17T09:09:42+01:00
Move isIrrefutableHsPat to GHC.Rename.Utils and rename to isIrrefutableHsPatRn

This removes edge from GHC.Hs.Pat to GHC.Driver.Session, which makes
Language.Haskell.Syntax end up depending on GHC.Driver.Session.

- - - - -
6cc6c144 by Matthew Pickering at 2023-05-17T09:09:43+01:00
Remove dependency of GHC.Tc.Types.Constraint on GHC.Driver.Session

- - - - -
740013e9 by Matthew Pickering at 2023-05-17T09:09:43+01:00
hole fit plugins: Split definition into own module

The hole fit plugins are defined in terms of TcM, a type we want to
avoid depending on from `GHC.Tc.Errors.Types`. By moving it into its own
module we can remove this dependency. It also simplifies the necessary
boot file.

- - - - -
3fb4e6c1 by Matthew Pickering at 2023-05-17T09:09:43+01:00
Move GHC.Core.Opt.CallerCC Types into separate module

This allows `GHC.Driver.DynFlags` to depend on these types without
depending on CoreM and hence the entire simplifier pipeline.

We can also remove a hs-boot file with this change.

- - - - -
0b0e48ad by Matthew Pickering at 2023-05-17T09:09:43+01:00
Remove unecessary SOURCE import

- - - - -


30 changed files:

- compiler/GHC/Core/Opt/CallerCC.hs
- − compiler/GHC/Core/Opt/CallerCC.hs-boot
- + compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/IOEnv.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Infer.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole.hs-boot
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- − compiler/GHC/Tc/Errors/Hole/FitTypes.hs-boot
- + compiler/GHC/Tc/Errors/Hole/Plugin.hs
- + compiler/GHC/Tc/Errors/Hole/Plugin.hs-boot
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- + compiler/GHC/Tc/Errors/Types/PromotionErr.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96d86d8dcf522d473cd1fda7a8e69d95394dd9ee...0b0e48ad87297472d8dacf6e6334b7d29b348fc5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96d86d8dcf522d473cd1fda7a8e69d95394dd9ee...0b0e48ad87297472d8dacf6e6334b7d29b348fc5
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/20230517/411445a4/attachment.html>


More information about the ghc-commits mailing list