[commit: ghc] master: Major patch to introduce TyConBinder (e368f32)
git at git.haskell.org
git at git.haskell.org
Wed Jun 15 16:32:32 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e368f3265b80aeb337fbac3f6a70ee54ab14edfd/ghc
>---------------------------------------------------------------
commit e368f3265b80aeb337fbac3f6a70ee54ab14edfd
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Jun 15 13:27:12 2016 +0100
Major patch to introduce TyConBinder
Before this patch, following the TypeInType innovations,
each TyCon had two lists:
- tyConBinders :: [TyBinder]
- tyConTyVars :: [TyVar]
They were in 1-1 correspondence and contained
overlapping information. More broadly, there were many
places where we had to pass around this pair of lists,
instead of a single list.
This commit tidies all that up, by having just one list of
binders in a TyCon:
- tyConBinders :: [TyConBinder]
The new data types look like this:
Var.hs:
data TyVarBndr tyvar vis = TvBndr tyvar vis
data VisibilityFlag = Visible | Specified | Invisible
type TyVarBinder = TyVarBndr TyVar VisibilityFlag
TyCon.hs:
type TyConBinder = TyVarBndr TyVar TyConBndrVis
data TyConBndrVis
= NamedTCB VisibilityFlag
| AnonTCB
TyCoRep.hs:
data TyBinder
= Named TyVarBinder
| Anon Type
Note that Var.TyVarBdr has moved from TyCoRep and has been
made polymorphic in the tyvar and visiblity fields:
type TyVarBinder = TyVarBndr TyVar VisibilityFlag
-- Used in ForAllTy
type TyConBinder = TyVarBndr TyVar TyConBndrVis
-- Used in TyCon
type IfaceForAllBndr = TyVarBndr IfaceTvBndr VisibilityFlag
type IfaceTyConBinder = TyVarBndr IfaceTvBndr TyConBndrVis
-- Ditto, in interface files
There are a zillion knock-on changes, but everything
arises from these types. It was a bit fiddly to get the
module loops to work out right!
Some smaller points
~~~~~~~~~~~~~~~~~~~
* Nice new functions
TysPrim.mkTemplateKiTyVars
TysPrim.mkTemplateTyConBinders
which help you make the tyvar binders for dependently-typed
TyCons. See comments with their definition.
* The change showed up a bug in TcGenGenerics.tc_mkRepTy, where the code
was making an assumption about the order of the kind variables in the
kind of GHC.Generics.(:.:). I fixed this; see TcGenGenerics.mkComp.
>---------------------------------------------------------------
e368f3265b80aeb337fbac3f6a70ee54ab14edfd
compiler/basicTypes/DataCon.hs | 68 +++-
compiler/basicTypes/DataCon.hs-boot | 4 +-
compiler/basicTypes/MkId.hs | 32 +-
compiler/basicTypes/PatSyn.hs | 8 +-
compiler/basicTypes/Var.hs | 104 +++++-
compiler/coreSyn/CoreFVs.hs | 2 +-
compiler/iface/BuildTyCl.hs | 65 ++--
compiler/iface/IfaceSyn.hs | 45 ++-
compiler/iface/IfaceType.hs | 98 ++----
compiler/iface/MkIface.hs | 69 ++--
compiler/iface/TcIface.hs | 71 ++--
compiler/main/HscTypes.hs | 2 +-
compiler/prelude/TysPrim.hs | 162 +++++----
compiler/prelude/TysWiredIn.hs | 167 ++++-----
compiler/prelude/TysWiredIn.hs-boot | 4 +
compiler/typecheck/Inst.hs | 4 +-
compiler/typecheck/TcBinds.hs | 2 +-
compiler/typecheck/TcCanonical.hs | 4 +-
compiler/typecheck/TcDeriv.hs | 4 +-
compiler/typecheck/TcFlatten.hs | 2 +-
compiler/typecheck/TcForeign.hs | 2 +-
compiler/typecheck/TcGenGenerics.hs | 20 +-
compiler/typecheck/TcHsSyn.hs | 25 +-
compiler/typecheck/TcHsType.hs | 99 +++---
compiler/typecheck/TcInstDcls.hs | 5 +-
compiler/typecheck/TcInteract.hs | 13 +-
compiler/typecheck/TcMType.hs | 16 +-
compiler/typecheck/TcPatSyn.hs | 22 +-
compiler/typecheck/TcRnTypes.hs | 2 +-
compiler/typecheck/TcSMonad.hs | 4 +-
compiler/typecheck/TcSigs.hs | 2 +-
compiler/typecheck/TcSplice.hs | 2 +-
compiler/typecheck/TcTyClsDecls.hs | 116 +++----
compiler/typecheck/TcTyDecls.hs | 4 +-
compiler/typecheck/TcType.hs | 7 +-
compiler/typecheck/TcTypeNats.hs | 14 +-
compiler/typecheck/TcUnify.hs | 9 +-
compiler/typecheck/TcValidity.hs | 6 +-
compiler/types/Class.hs | 15 +-
compiler/types/TyCoRep.hs | 198 ++++-------
compiler/types/TyCoRep.hs-boot | 4 -
compiler/types/TyCon.hs | 374 ++++++++++++---------
compiler/types/TyCon.hs-boot | 5 -
compiler/types/Type.hs | 62 ++--
compiler/types/Type.hs-boot | 1 +
compiler/vectorise/Vectorise/Generic/PData.hs | 7 +-
compiler/vectorise/Vectorise/Type/Env.hs | 2 +-
compiler/vectorise/Vectorise/Type/TyConDecl.hs | 8 +-
testsuite/tests/ado/ado002.stderr | 2 +-
testsuite/tests/driver/werror.stderr | 2 +-
testsuite/tests/gadt/gadt13.stderr | 6 +-
testsuite/tests/gadt/gadt7.stderr | 8 +-
.../tests/generics/T10604/T10604_deriving.stderr | 2 +-
.../tests/ghci.debugger/scripts/break003.stderr | 2 +-
.../tests/ghci.debugger/scripts/break003.stdout | 8 +-
.../tests/ghci.debugger/scripts/break005.stdout | 4 +-
.../tests/ghci.debugger/scripts/break006.stderr | 12 +-
.../tests/ghci.debugger/scripts/break006.stdout | 10 +-
.../tests/ghci.debugger/scripts/hist001.stdout | 28 +-
testsuite/tests/ghci/prog010/ghci.prog010.stdout | 8 +-
testsuite/tests/ghci/scripts/T11524a.stdout | 22 +-
testsuite/tests/ghci/scripts/T6018ghcifail.stderr | 2 +-
testsuite/tests/ghci/scripts/T7627.stdout | 6 +-
testsuite/tests/ghci/scripts/T8535.stdout | 2 +-
testsuite/tests/ghci/scripts/T8776.stdout | 2 +-
testsuite/tests/ghci/scripts/ghci013.stdout | 2 +-
testsuite/tests/ghci/scripts/ghci020.stdout | 2 +-
testsuite/tests/ghci/scripts/ghci059.stdout | 2 +-
testsuite/tests/ghci/should_run/T10145.stdout | 2 +-
.../indexed-types/should_compile/T3017.stderr | 2 +-
.../indexed-types/should_fail/ExtraTcsUntch.stderr | 28 +-
testsuite/tests/parser/should_fail/T7848.stderr | 4 +-
.../partial-sigs/should_compile/T10403.stderr | 29 +-
.../partial-sigs/should_compile/T11192.stderr | 27 +-
.../partial-sigs/should_compile/T12033.stderr | 10 +-
.../WarningWildcardInstantiations.stderr | 4 +-
.../tests/partial-sigs/should_fail/T10045.stderr | 15 +-
.../should_fail/WildcardInstantiations.stderr | 4 +-
.../tests/patsyn/should_compile/T11213.stderr | 12 +-
testsuite/tests/patsyn/should_fail/T11053.stderr | 8 +-
testsuite/tests/patsyn/should_run/ghci.stdout | 2 +-
testsuite/tests/polykinds/T7328.stderr | 5 +-
testsuite/tests/polykinds/T7438.stderr | 20 +-
testsuite/tests/polykinds/T9017.stderr | 7 +-
testsuite/tests/rebindable/rebindable6.stderr | 4 +-
testsuite/tests/rename/should_fail/T10618.stderr | 2 +-
.../tests/typecheck/should_compile/tc141.stderr | 14 +-
.../should_fail/FailDueToGivenOverlapping.stderr | 4 +-
.../tests/typecheck/should_fail/T10351.stderr | 4 +-
.../tests/typecheck/should_fail/T11355.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T5858.stderr | 6 +-
.../tests/typecheck/should_fail/T6018fail.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T8142.stderr | 14 +-
testsuite/tests/typecheck/should_fail/T9109.stderr | 7 +-
.../tests/typecheck/should_fail/VtaFail.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail001.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail010.stderr | 2 +-
.../tests/typecheck/should_fail/tcfail012.stderr | 8 +-
.../tests/typecheck/should_fail/tcfail013.stderr | 4 +-
.../tests/typecheck/should_fail/tcfail016.stderr | 8 +-
.../tests/typecheck/should_fail/tcfail033.stderr | 8 +-
.../tests/typecheck/should_fail/tcfail069.stderr | 12 +-
.../tests/typecheck/should_fail/tcfail182.stderr | 16 +-
.../tests/typecheck/should_fail/tcfail201.stderr | 4 +-
104 files changed, 1247 insertions(+), 1150 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e368f3265b80aeb337fbac3f6a70ee54ab14edfd
More information about the ghc-commits
mailing list