[In ghc-2.10 and ghc-3.01]

The ghc version of the ST module

  ghc/lib/exts/ST.lhs

makes (ST s) a Monad but not a Functor.

In hugs 1.4 February it is both a Monad and a Functor.

I don't know where to look for a formal definition for these extension
libraries, but I think hugs is right and that the Functor instance should
be there.

Patrik Jansson
------------------------------------------------------------------------
import ST
main = print (runST (map id (return True)))
 
STtest.hs:2: No instance for: `Functor (ST taLs)'
    arising from use of `map' at STtest.hs:2
    In a polymorphic function argument `(map id (return True))'
    In the first argument of `runST', namely `(map id (return True))'
    In the first argument of `print', namely
        `(runST (map id (return True)))'

Compilation had errors


Reply via email to