
14 Dec
2004
14 Dec
'04
2:52 a.m.
oleg@pobox.com wrote: [...]
However, if we try
t2' = W $ id
we get an error:
/tmp/t1.hs:13: Inferred type is less polymorphic than expected Quantified type variable `a' escapes Expected type: (a -> a) -> b Inferred type: (forall a1. a1 -> a1) -> W In the first argument of `($)', namely `W' In the definition of `t2'': t2' = W $ id
Incidentally, Hugs -98 gives a quite bizarre error message
ERROR "/tmp/t1.hs":13 - Use of W requires at least 1 argument
This is also the reason we write runST (do ...) instead of runST $ do ... isn't it?