diff options
author | Richard Eisenberg <rae@richarde.dev> | 2019-11-05 13:11:19 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-08 10:16:33 -0500 |
commit | 7755ffc2920facb7ed74efe379ad825feeaf1024 (patch) | |
tree | c2bcece9de4776d99af32265084b78b7735d6654 /compiler/GHC/Hs.hs | |
parent | 309f8cfdad9cf81f5ee6003821810ea1205ae1d5 (diff) | |
download | haskell-7755ffc2920facb7ed74efe379ad825feeaf1024.tar.gz |
Introduce IsPass; refactor wrappers.
There are two main payloads of this patch:
1. This introduces IsPass, which allows e.g. printing
code to ask what pass it is running in (Renamed vs
Typechecked) and thus print extension fields. See
Note [IsPass] in Hs.Extension
2. This moves the HsWrap constructor into an extension
field, where it rightly belongs. This is done for
HsExpr and HsCmd, but not for HsPat, which is left
as an exercise for the reader.
There is also some refactoring around SyntaxExprs, but this
is really just incidental.
This patch subsumes !1721 (sorry @chreekat).
Along the way, there is a bit of refactoring in GHC.Hs.Extension,
including the removal of NameOrRdrName in favor of NoGhcTc.
This meant that we had no real need for GHC.Hs.PlaceHolder, so
I got rid of it.
Updates haddock submodule.
-------------------------
Metric Decrease:
haddock.compiler
-------------------------
Diffstat (limited to 'compiler/GHC/Hs.hs')
-rw-r--r-- | compiler/GHC/Hs.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/Hs.hs b/compiler/GHC/Hs.hs index ecd891b52e..999d59ea7a 100644 --- a/compiler/GHC/Hs.hs +++ b/compiler/GHC/Hs.hs @@ -12,8 +12,8 @@ therefore, is almost nothing but re-exporting. {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] - -- in module GHC.Hs.PlaceHolder +{-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow] + -- in module GHC.Hs.Extension {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} -- For deriving instance Data @@ -28,7 +28,6 @@ module GHC.Hs ( module GHC.Hs.Types, module GHC.Hs.Utils, module GHC.Hs.Doc, - module GHC.Hs.PlaceHolder, module GHC.Hs.Extension, Fixity, @@ -43,7 +42,6 @@ import GHC.Hs.Binds import GHC.Hs.Expr import GHC.Hs.ImpExp import GHC.Hs.Lit -import GHC.Hs.PlaceHolder import GHC.Hs.Extension import GHC.Hs.Pat import GHC.Hs.Types |