Hey everyone,

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.  I can see what's going on:  it can't tell that 
the "a" I am writing there is the same "a" that's in the type specification, 
but is there any way that I can make it identify "a" with the "a" in the 
specification for nextPtr?

Cheers,
Greg

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to