Skip to content
  • Simon Peyton Jones's avatar
    Make let-floating work even if there are big lambdas in the way · 3ceff7a4
    Simon Peyton Jones authored
    This patch generalises the let-floating transformation in a way
    suggested by Roman and Manuel when doing closure conversion.
    
    There are extensive comments in Note [Floating and type abstraction],
    which begins thus.  Consider this:
    	x = /\a. C e1 e2
    We'd like to float this to 
    	y1 = /\a. e1
    	y2 = /\a. e2
    	x = /\a. C (y1 a) (y2 a)
    for the usual reasons: we want to inline x rather vigorously.
    
    (Further commennts follow in SimplUtils.)
    
    
    
    The implementation is not hard; indeed it used to be in GHC years ago.
    I removed it thinking that full laziness would achieve the same
    effect, but I'm not sure it does; and in any case it seems more direct
    to do it here.
    
    The transformation should not make anything worse, so yell if 
    you see anything unexpected happening.
    
    3ceff7a4