Skip to content
  • Simon Peyton Jones's avatar
    Improve the loop-breaking heuristics · 1dca1587
    Simon Peyton Jones authored
    The loop-breaking heuristics were making it a high priority to
    avoid choosing a variable as a loop breaker if its *type* was a 
    data type.  The reason is that it's very good to be able to "see"
    constructor applications.
    
    But it's only good if the constructor application is *visible*, 
    so that is what I test for now.  I found a case (when testing 
    SpecConstr) where I had a Rec like this:
    	rec { lvl = foo Nothing
    	      foo = ...
    	        RULE foo Nothing = ...
       	    }
    
    Even if lvl has a data type, it's much better to make lvl the loop
    breaker, not foo, so that foo's RULE is visible in lvl's RHS.
    1dca1587