Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2001-06-25 08:01:16 by simonpj] · a12bed53
    Simon Peyton Jones authored
    ----------------------------------
    	Fix a predicate-simplification bug
    	----------------------------------
    
    Fixes a bug pointed out by Marcin
    
        data R = R {f :: Int}
        foo:: (?x :: Int) => R -> R
        foo r = r {f = ?x}
    
        Test.hs:4:
    	Could not deduce `?x :: Int' from the context ()
    	arising from use of implicit parameter `?x' at Test.hs:4
    	In the record update: r {f = ?x}
    	In the definition of `foo': r {f = ?x}
    
    The predicate simplifier was declining to 'inherit' an
    implicit parameter.  This is right for a let-binding, but
    wrong for an expression binding.  For example, a simple
    expression type signature:
    
    		(?x + 1) :: Int
    
    This was rejected because the ?x constraint could not be
    floated out -- but that's wrong for expressions.
    a12bed53