diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-15 13:27:12 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-15 17:36:02 +0100 |
commit | e368f3265b80aeb337fbac3f6a70ee54ab14edfd (patch) | |
tree | c38b396e267a5f8172751daa8f985c22d6f92760 /testsuite/tests/ghci/scripts/T11524a.stdout | |
parent | 77bb09270c70455bbd547470c4e995707d19f37d (diff) | |
download | haskell-e368f3265b80aeb337fbac3f6a70ee54ab14edfd.tar.gz |
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.
Diffstat (limited to 'testsuite/tests/ghci/scripts/T11524a.stdout')
-rw-r--r-- | testsuite/tests/ghci/scripts/T11524a.stdout | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/testsuite/tests/ghci/scripts/T11524a.stdout b/testsuite/tests/ghci/scripts/T11524a.stdout index 0a9dddbaec..164e0cf256 100644 --- a/testsuite/tests/ghci/scripts/T11524a.stdout +++ b/testsuite/tests/ghci/scripts/T11524a.stdout @@ -3,11 +3,11 @@ without -fprint-explicit-foralls pattern P :: Bool -- Defined at <interactive>:16:1 pattern Pe :: a -> Ex -- Defined at <interactive>:17:1 pattern Pu :: t -> t -- Defined at <interactive>:18:1 -pattern Pue :: t -> a -> (t, Ex) -- Defined at <interactive>:19:1 +pattern Pue :: a -> a1 -> (a, Ex) -- Defined at <interactive>:19:1 pattern Pur :: (Num a, Eq a) => a -> [a] -- Defined at <interactive>:20:1 -pattern Purp :: (Num a, Eq a) => Show t => a - -> t -> ([a], UnivProv t) +pattern Purp :: (Num a1, Eq a1) => Show a => a1 + -> a -> ([a1], UnivProv a) -- Defined at <interactive>:21:1 pattern Pure :: (Num a, Eq a) => a -> a1 -> ([a], Ex) -- Defined at <interactive>:22:1 @@ -16,9 +16,9 @@ pattern Purep :: (Num a, Eq a) => Show a1 => a -- Defined at <interactive>:23:1 pattern Pep :: () => Show a => a -> ExProv -- Defined at <interactive>:24:1 -pattern Pup :: () => Show t => t -> UnivProv t +pattern Pup :: () => Show a => a -> UnivProv a -- Defined at <interactive>:25:1 -pattern Puep :: () => Show a => a -> t -> (ExProv, t) +pattern Puep :: () => Show a => a -> b -> (ExProv, b) -- Defined at <interactive>:26:1 with -fprint-explicit-foralls @@ -27,12 +27,12 @@ pattern P :: Bool -- Defined at <interactive>:16:1 pattern Pe :: () => forall {a}. a -> Ex -- Defined at <interactive>:17:1 pattern Pu :: forall {t}. t -> t -- Defined at <interactive>:18:1 -pattern Pue :: forall {t}. () => forall {a}. t -> a -> (t, Ex) +pattern Pue :: forall {a}. () => forall {a1}. a -> a1 -> (a, Ex) -- Defined at <interactive>:19:1 pattern Pur :: forall {a}. (Num a, Eq a) => a -> [a] -- Defined at <interactive>:20:1 -pattern Purp :: forall {t} {a}. (Num a, Eq a) => Show t => a - -> t -> ([a], UnivProv t) +pattern Purp :: forall {a} {a1}. (Num a1, Eq a1) => Show a => a1 + -> a -> ([a1], UnivProv a) -- Defined at <interactive>:21:1 pattern Pure :: forall {a}. (Num a, Eq a) => forall {a1}. a -> a1 -> ([a], Ex) @@ -42,8 +42,8 @@ pattern Purep :: forall {a}. (Num a, Eq a) => forall {a1}. Show -- Defined at <interactive>:23:1 pattern Pep :: () => forall {a}. Show a => a -> ExProv -- Defined at <interactive>:24:1 -pattern Pup :: forall {t}. () => Show t => t -> UnivProv t +pattern Pup :: forall {a}. () => Show a => a -> UnivProv a -- Defined at <interactive>:25:1 -pattern Puep :: forall {t}. () => forall {a}. Show a => a - -> t -> (ExProv, t) +pattern Puep :: forall {b}. () => forall {a}. Show a => a + -> b -> (ExProv, b) -- Defined at <interactive>:26:1 |