RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10
I don't think we have much choice about whether undefined values are part of the type. If you can create a value of that type:
x <- derefPtr (px :: Ptr T)
I'm not following this. what exactly is derefPtr? The only analogous function I can think of is Foreign.peek: peek :: Storable a => Ptr a -> IO a but peek will unmarshal the value at the end of the Ptr into T, so T cannot be abstract. Cheers, Simon
I'm not following this. what exactly is derefPtr? The only analogous function I can think of is Foreign.peek:
Sorry, I meant peek.
but peek will unmarshal the value at the end of the Ptr into T, so T cannot be abstract.
Sorry, I was just trying to show how to create a value of type T which might be bottom. It would have been easier to use: t :: T t = undefined -- Alastair
On 02-Jun-2003, Alastair Reid <alastair@reid-consulting-uk.ltd.uk> wrote:
I was just trying to show how to create a value of type T which might be bottom. It would have been easier to use:
t :: T t = undefined
The same issue arises for ghc's unboxed types, of course. ghc has some complicated extension to the type system to deal with it, which makes examples like the one above type errors if T is an unboxed type. -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
participants (3)
-
Alastair Reid -
Fergus Henderson -
Simon Marlow