[Hugs-users] the bug or not the bug? :)

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Mar 3 18:30:15 EST 2006


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:Bulat.Ziganshin at gmail.com



More information about the Hugs-Users mailing list