4 Mar
2006
4 Mar
'06
5 a.m.
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@gmail.com