Hello ,
The following code compiles with GHC but not with Hugs. moreover, if
you replace STURef with STRef in instance definition, all will be
fine. bug?
{-# OPTIONS_GHC -cpp -fglasgow-exts #-}
import Control.Monad.ST
import Data.STRef
-- -----------------------------------------------------------------------------
-- Unboxed references in ST monad
type STURef = STRef
-- | Create new unboxed reference in ST monad
newSTURef :: e -> ST s (STURef s e)
newSTURef = newSTRef
-- -----------------------------------------------------------------------------
-- Monad-neutral interface for fast unboxed references
class (Monad m) => URef m r | m->r, r->m where
newURef :: a -> m (r a)
instance URef (ST s) (STURef s) where
newURef = newSTURef
-- -----------------------------------------------------------------------------
-- Main
test = runST ( do newURef (0::Int)
return '1'
)
--
Best regards,
Bulat mailto:[EMAIL PROTECTED]
_______________________________________________
Hugs-Users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hugs-users