Problem with lexically scoped type variables.

Simon Peyton-Jones simonpj at microsoft.com
Mon Oct 2 10:50:41 EDT 2006


| > | t1 = runST (trav f [1..10] (1,52) >>= \ (s::STRef s (Set Int)) ->
seen
| > s)
| >
| > try
| >
| > t1 = runST ( (trav f [1..10] (1,52) >>= \ s -> seen s)
| > 		:: forall s. ST s [Int] )
| 
| No, the problem is that t1 should use another implementation than t2.
| This version cannot discriminate between different implementations
| anymore. (And logically it did not compile.)

Oh I see. Well, you'd need to put the type annotation for s back in:

t1 = runST ( (trav f [1..10] (1,52) >>= \ (s::STRef s (Set Int)) -> seen
s)
 		:: forall s. ST s [Int] )

Simon


More information about the Glasgow-haskell-users mailing list