diff options
author | Iavor S. Diatchki <diatchki@galois.com> | 2013-11-12 16:36:23 -0800 |
---|---|---|
committer | Iavor S. Diatchki <diatchki@galois.com> | 2013-11-12 16:36:23 -0800 |
commit | b2fa2d41032882d3cf67be083489cbcbf9e4ec07 (patch) | |
tree | 26553fc7fe4d037578a40283dbb9263bba2496a3 /compiler/utils/FiniteMap.lhs | |
parent | 1c17d00fbe28589097dc1cf2005be3b38586c194 (diff) | |
download | haskell-b2fa2d41032882d3cf67be083489cbcbf9e4ec07.tar.gz |
Make type-level evaluation work with :kind!
The main change is to add a case to `reduceTyFamApp_maybe` to evaluate
built-in type constructors (e.g., (+), (*), and friends).
To avoid problems with recursive modules, I moved the definition of
TcBuiltInSynFamily from `FamInst` to `FamInstEnv`. I am still not sure if
this is the right place.
There is also a wibble that it'd be nice to fix:
when we evaluate a built-in type function, using`sfMatchFam`, we get
a `TcCoercion`. However, `reduceTyFamApp_maybe` needs a `Corecion`.
I couldn't find a nice way to convert between the two, so I resorted to
a bit of hack (marked with `XXX`).
The hack is that we happen to know that the built-in constructors for
the type-nat functions always return coercions of shape `TcAxiomRuleCo`,
with no assumptions, so it easy to convert `TcCoercion` to `Coercion`
in this one case. This is enough to make things work, but it is clearly
a cludge.
Diffstat (limited to 'compiler/utils/FiniteMap.lhs')
0 files changed, 0 insertions, 0 deletions