• simonpj@microsoft.com's avatar
    Do pre-subsumption in the main subsumption check · af20907a
    simonpj@microsoft.com authored
    This patch improves the subsumption check (in TcUnify.tc_sub) so that
    it does pre-subsumption first.  The key code is in the case with
    guard (isSigmaTy actual_ty); note the new call to preSubType.
    
    Shorn of details, the question is this.  Should this hold?
    
    	forall a. a->a   <=   Int -> (forall b. Int)
    
    Really, it should; just instantiate 'a' to Int.  This is just what
    the pre-subsumption phase (which used in function applications),
    will do.
    
    I did a bit of refactoring to achieve this.
    
    Fixes Trac #821.  Test tc205 tests.
    af20907a
TcPat.lhs 30.2 KB