Hello

one more example that works in GHC but not Hugs. why i'm so unlucky? :)


import Foreign.Storable
import Foreign.ForeignPtr

class (Monad m) => STorIO m s | m->s where
    mLift :: IO a -> m a

newtype MBA s a = MBA (ForeignPtr a)

class (Storable value) => Unboxed value where
    readUnboxed :: (STorIO m s)
                => MBA s value -> m value
    readUnboxed (MBA arr) = mLift $
        withForeignPtr arr $ \a -> peek a
  

-- 
Best regards,
 Bulat                          mailto:[EMAIL PROTECTED]

_______________________________________________
Hugs-Users mailing list
Hugs-Users@haskell.org
http://www.haskell.org/mailman/listinfo/hugs-users

Reply via email to