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
| > 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
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
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
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
"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:
> >
>
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
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