summaryrefslogtreecommitdiff
path: root/ghc/compiler/specialise
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-07-14 08:17:41 +0000
committersimonpj <unknown>2000-07-14 08:17:41 +0000
commit77a8c0dbd5c5ad90fe483cb9ddc2b6ef36d3f4d8 (patch)
tree4db0f73ca34a0ac74a95b650a72301b8223b080d /ghc/compiler/specialise
parent8d873902b0ba7e267089f9e1faf690368670fe62 (diff)
downloadhaskell-77a8c0dbd5c5ad90fe483cb9ddc2b6ef36d3f4d8.tar.gz
[project @ 2000-07-14 08:17:36 by simonpj]
This commit completely re-does the kind-inference mechanism. Previously it was inter-wound with type inference, but that was always hard to understand, and it finally broke when we started checking for ambiguity when type-checking a type signature (details irrelevant). So now kind inference is more clearly separated, so that it never takes place at the same time as type inference. The biggest change is in TcTyClsDecls, which does the kind inference for a group of type and class declarations. It now contains comments to explain how it all works. There are also comments in TypeRep which describes the slightly tricky way in which we deal with the fact that kind 'type' (written '*') actually has 'boxed type' and 'unboxed type' as sub-kinds. The whole thing is a bit of a hack, because we don't really have sub-kinding, but it's less of a hack than before. A lot of general tidying up happened at the same time. In particular, I removed some dead code here and there
Diffstat (limited to 'ghc/compiler/specialise')
-rw-r--r--ghc/compiler/specialise/Specialise.lhs16
1 files changed, 8 insertions, 8 deletions
diff --git a/ghc/compiler/specialise/Specialise.lhs b/ghc/compiler/specialise/Specialise.lhs
index d73e2c3f41..884d70be5c 100644
--- a/ghc/compiler/specialise/Specialise.lhs
+++ b/ghc/compiler/specialise/Specialise.lhs
@@ -820,10 +820,10 @@ specDefn subst calls (fn, rhs)
-- It's role as a holder for a call instance is o'er
-- But it might be alive for some other reason by now.
- fn_type = idType fn
- (tyvars, theta, tau) = splitSigmaTy fn_type
- n_tyvars = length tyvars
- n_dicts = length theta
+ fn_type = idType fn
+ (tyvars, theta, _) = splitSigmaTy fn_type
+ n_tyvars = length tyvars
+ n_dicts = length theta
(rhs_tyvars, rhs_ids, rhs_body) = collectTyAndValBinders rhs
rhs_dicts = take n_dicts rhs_ids
@@ -985,10 +985,10 @@ mkCallUDs subst f args
calls = singleCall f spec_tys dicts
}
where
- (tyvars, theta, tau) = splitSigmaTy (idType f)
- constrained_tyvars = tyVarsOfTheta theta
- n_tyvars = length tyvars
- n_dicts = length theta
+ (tyvars, theta, _) = splitSigmaTy (idType f)
+ constrained_tyvars = tyVarsOfTheta theta
+ n_tyvars = length tyvars
+ n_dicts = length theta
spec_tys = [mk_spec_ty tv ty | (tv, Type ty) <- tyvars `zip` args]
dicts = [dict_expr | (_, dict_expr) <- theta `zip` (drop n_tyvars args)]