Changes between Version 135 and Version 136 of TypeFunctionsStatus

Jan 9, 2007 2:11:53 AM (11 years ago)



  • TypeFunctionsStatus

    v135 v136  
    4242 1. Type checking of type functions (and hence, associated type synonyms); routines in `TcUnify` that need to be extended:
    4343   * `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.
     44   * `boxySplitAppTy`: Basically, the same deal as the previous.
     45   * `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.
     46   * `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?
     47   * `boxy_lub`: Unclear.  Also seems to approximate.
     48   * `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.
     49   * `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!!!
    4450  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.
    4551 2. Type checking in the presence of associated synonym defaults.  (Default AT synonyms are only allowed for ATs defined in the same class.)