Re: RFC: An extended Addr module

1999-10-13 Thread Michael Weber
On Tue, Oct 12, 1999 at 02:50:33 -0700, Simon Peyton-Jones wrote: [non-H98 compliant version] >> That's of course exactly what one wants to write, but AFAIK this is not >> Haskell 98, so I wanted to avoid it. Or is it Haskell 98? %-} > It's not H98, but you could instead write > instance

RE: RFC: An extended Addr module

1999-10-12 Thread Simon Peyton-Jones
| > Maybe I'm totally missing the point, but what about that: | > | > \begin{code} | > instance Marshalable a => Marshalable (Vec3 a) where | > indexOffAddr buf off = do | >let sizeOfPolymorphicA = sizeOf (undefined::a) | >... | > \end{code} | > [...] | | That's of course exa

Re: RFC: An extended Addr module

1999-10-12 Thread Sven Panne
In a private EMail Michael Weber wrote: > On Fri, Oct 08, 1999 at 13:57:14 +0200, Sven Panne wrote: > > [...] > > data Vec3 a = Vec3 a a a > > > > instance Marshalable a => Marshalable (Vec3 a) where > >sizeOf(Vec3 x _ _) = 3 * sizeOf x > > [...] > Maybe I'm totally missing the point, but

Re: RFC: An extended Addr module

1999-10-10 Thread Sven Panne
After fiddling around a little bit I think that there is room for even more unification. The Foreign module exports some functions quite similar to those exported from Addr, so here is my next proposal: -- class MemInfo a where

Re: RFC: An extended Addr module

1999-10-10 Thread Sven Panne
I wrote: > [...] > instance Marshalable a => Marshalable (Vec3 a) where >sizeOf(Vec3 x _ _) = 3 * sizeOf x >alignment (Vec3 x _ _) = alignment x > [...] After a segmentation fault in my OpenGL binding (thanks to Manuel for pointing this out) I came to the conclusion that this should

Re: RFC: An extended Addr module

1999-10-08 Thread Sven Panne
"Manuel M. T. Chakravarty" wrote: > Some bits & pieces: > >* After playing around with this module, I think that it is a > > Good Thing (tm) that ...OffAddr use element offsets and not > > byte offsets. It makes instance declarations of the following > > form much easier: > > >

Re: RFC: An extended Addr module

1999-10-08 Thread Manuel M. T. Chakravarty
Sven Panne <[EMAIL PROTECTED]> wrote, > GHC's Addr module is meant to be used in conjunction with the FFI (at > least this is what the docs told me :-), but its plethora of similar > functions is not very nice and some often needed functionality is > missing. Attached is my proposed new version o

RFC: An extended Addr module

1999-10-06 Thread Sven Panne
GHC's Addr module is meant to be used in conjunction with the FFI (at least this is what the docs told me :-), but its plethora of similar functions is not very nice and some often needed functionality is missing. Attached is my proposed new version of Addr, being very similar to the things in the