Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2000-03-27 13:23:49 by simonpj] · 8ddfc3c1
    Simon Peyton Jones authored
    Improve the error messages given when a definition isn't polymorphic enough.
    In paticular, for this program:
    
        let v = runST (newSTRef True)
        in
        runST (readSTRef v)
    
    we get the message
    
        Inferred type is less polymorphic than expected
    	Quantified type variable `s' escapes
    	It is reachable from the type variable(s) `a'
    	  which are free in the signature
        Signature type:     forall s. ST s a
        Type to generalise: ST s (STRef s Bool)
        When checking an expression type signature
        In the first argument of `runST', namely `(newSTRef True)'
        In the right-hand side of a pattern binding: runST (newSTRef True)
    8ddfc3c1