Skip to content
Snippets Groups Projects
Commit 8ddfc3c1 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

[project @ 2000-03-27 13:23:49 by simonpj]

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)
parent 36908417
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment