GHC Trac Home
Working on GHC
Mailing Lists & IRC
All Feature Req's
Tickets I Created
Patches for review
New Feature Req
Forgot your password?
side by side
lines around each change
White space changes
01/08/07 18:11:53 (
1. Type checking of type functions (and hence, associated type synonyms); routines in `TcUnify` that need to be extended:
* `boxySplitTyConApp`: The second argument (`BoxyRhoType`) can be a synonym family application. Then, we must produce a wanted coercion and return a `HsWrapper` value that applies that coercion.
* `boxySplitAppTy`: Basically, the same deal as the previous.
* `boxySubMatchType`: Not sure yet. Do we need to handle the case where in `go` one type is `FunTy` and the other a synonym family application? But the function doesn't handle the case where a `FunTy` meets a tyvar either, so its probably ok to ignore.
* `boxy_match`: Not sure yet. Do we have to handle the case where `t_ty` is a synonym family application? On the other hand, this prematching seems to be an approximation. How much does it hurt if we just ignore this?
* `boxy_lub`: Unclear. Also seems to approximate.
* `tcSubExp`: Probably need a case similar to the case marked ''(rule F2)''. This function already returns a coercion, so hopefully it is easy to extend that without changing the interface.
* `uTysOuter`, `u_tys`, `uPred`, `uVar`, and their intefaces `boxyUnify`, `boxyUnifyList`, `unifyType`, `unifyPred`, `unifyTheta`, and `unifyTypeList`: Generate wanted equalities and produce coercion(s). !!!Still need to check usage patterns!!!
To make things easy, we might want to always return a `HsWrapper` value (unless the unification fails), which is `WpHole` whenever the coercion is empty. The disadvantage is that this blows the tree between type checking and desugaring up. An alternative is to return the coercion only when needed, but write some auxilliary functions that take the result of `boxySplitTyConApp` and friends and turn the optional coercion result in an always present (real Haskell) function that we always apply to the type-checked pattern (in `TcPat`) or expression. It is simply `id` when we don't need a coercion.
2. Type checking in the presence of associated synonym defaults. (Default AT synonyms are only allowed for ATs defined in the same class.)