
18 Dec
2009
18 Dec
'09
8:09 p.m.
Hi,
I would like to write a routine like
nextPtr :: Storable a => Ptr a -> Ptr a nextPtr = (`plusPtr` sizeOf (undefined :: a))
which increments a pointer by the correct amount, but GHC complains that the type variable "a" is ambiguous.
Maybe Foreign.Marshal.Array.advancePtr is what you really need in this case. Gergely -- http://www.fastmail.fm - The professional email service