RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Simon Marlow
> On 02-Jun-2003, Simon Marlow <[EMAIL PROTECTED]> wrote: > > > > I can't see how to acquire a value of type T that isn't bottom. > > By calling a function defined using the FFI, of course. But the FFI lists the types that may be returned by a foreign function, and T is not one of them. Are

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Fergus Henderson
On 02-Jun-2003, Simon Marlow <[EMAIL PROTECTED]> wrote: > > I can't see how to acquire a value of type T that isn't bottom. By calling a function defined using the FFI, of course. -- Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit The University of Melbourne

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Fergus Henderson
On 02-Jun-2003, Alastair Reid <[EMAIL PROTECTED]> 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 complic

RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Simon Marlow
> > 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 crea

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Alastair Reid
> 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 w

RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Simon Marlow
> 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 :: Sto

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Alastair Reid
On Monday 02 June 2003 11:14 am, Malcolm Wallace wrote: > How about something like: > > The declaration > data T > declares an abstract datatype T, whose values and operations are > defined external to the Haskell language. Values of T follow > the semantics of the foreign language,

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Malcolm Wallace
John Meacham wrote: > > This was discussed here before and there seemed to be some support for > > it, but how about adding the empty data declaration extension to the FFI > > spec? I agree, it would be a suitable addition to the FFI, since it is the place where such types make most sense. Alas

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Marcin 'Qrczak' Kowalczyk
Dnia nie 1. czerwca 2003 23:55, Alastair Reid napisaƂ: > introduces a type T whose only value is bottom. > ]] > > This semantics is obviously flawed though because it would suggest that any > two values of type T are equal (and equal to bottom) and that optimizations > based on that equality are

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-02 Thread Alastair Reid
On Saturday 31 May 2003 10:11 pm, John Meacham wrote: > This was discussed here before and there seemed to be some support for > it, but how about adding the empty data declaration extension to the FFI > spec? I strongly agree that we should definitely add the ability to declare types whose defin