> THEN ghc (versions 2.10, 3.02, 4.01) complain
>
> No instance for `Monad (-> Int)'
> arising from use of `return' at <FILE & LINE>
>
>
> But the problem is cured by adding this line in the module which won't
> compile
>
> > {-#SPECIALISE instance Monad ((->) Int) #-}
Ah, how embarassing. The renamer is parsimonious about hauling in
instance declarations (because there can be a *lot* of them), and was
negelecting to haul in ones involving (->) unless you had an explicit
mention of same. (That's why the pragma changed things.)
The workaround is to mention (->) explicitly anywhere
in the importing module.
We've just frozen the bits for 4.02, so the (one line) fix won't
be in it; sorry. (Announcement imminent.)
Thanks for a fine bug report
Simon