Hi, I'm trying to write a Storable instance for timespec using c2hs. Since timespec is defined something like:
struct timespec { time_t tv_sec; long tv_nsec; }; I've defined the following in Haskell: #include <sys/time.h> #c typedef struct timespec timespec_t; #endc data TimeSpec = TimeSpec { seconds :: CTime , nanoseconds :: CLong } instance Storable TimeSpec where peek t = TimeSpec <$> {#get timespec_t->tv_sec #} t <*> {#get timespec_t->tv_nsec#} t ... However, this fails to compile. For tv_sec, c2hs generates "peekByteOff ptr 0 :: IO CLong" instead of "IO CTime". Why is this? Am I doing something wrong, or is there a bug/missing feature in c2hs? Erik _______________________________________________ C2hs mailing list C2hs@haskell.org http://www.haskell.org/mailman/listinfo/c2hs