the bug or not the bug? :)
Bulat Ziganshin <[email protected]> Sat, 4 Mar 2006 02:30:15 +0300
| Newsgroups | gmane.comp.lang.haskell.hugs.user |
|---|---|
| Message-ID | <[email protected]> |
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]