Changes between Version 17 and Version 18 of Commentary/Compiler/StrictnessAnalysis/KirstenNotes


Ignore:
Timestamp:
Nov 15, 2006 5:47:28 PM (7 years ago)
Author:
kirsten
Comment:

coercions

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/StrictnessAnalysis/KirstenNotes

    v17 v18  
    6969 
    7070There are two possible easy solutions: don't float out bindings for strict things, or "both" the demand for a binder with Lazy when its binding gets floated out. The question is, is it better to do the let-floating and lose the strictness into or to evaluate something strictly but lose sharing? 
     71 
     72= Coercions = 
     73 
     74When we run into an expression like {{{(Cast e co)}}} that we're placing demand {{{d}}} on, we analyze {{{e}}} to get {{{dmd_ty}}}, then check whether the depth of {{{e}}} is equal to the depth of {{{dmd_ty}}} or not. This is necessary because we might be casting a function to a non-function type. So, if {{{d}}} and {{{dmd_ty}}} have equal depth, we return {{{dmd_ty}}} as is; if {{{d}}}'s arity is less, we drop the appropriate number of args from {{{dmd_ty}}}; if {{{dmd_ty}}}'s arity is less, we add the appropriate number of dummy argument demands to it.