Skip to content
  • Simon Peyton Jones's avatar
    Tidy up a remaining glitch in unification · 67c793a3
    Simon Peyton Jones authored
    There was one place, in type checking parallel list comprehensions
    where we were unifying types, but had no convenient way to use the
    resulting coercion; instead we just checked that it was Refl.  This
    was Wrong Wrong; it might fail unpredicably in a GADT-like situation,
    and it led to extra error-generation code used only in this one place.
    
    This patch tidies it all up, by moving the 'return' method from the
    *comprehension* to the ParStmtBlock. The latter is a new data type,
    now used for each sub-chunk of a parallel list comprehension.
    
    Because of the data type change, quite a few modules are touched,
    but only in a fairly trivial way. The real changes are in TcMatches
    (and corresponding desugaring); plus deleting code from TcUnify.
    
    This patch also fixes the pretty-printing bug in Trac #6060
    67c793a3