Say I have this struct in C:
/* C */
struct foo {
char *name;
int (*links)(foo*);
/* ... */
};
If I have x :: Ptr Foo, how do I get a FunPtr to x‘s links, without
using castPtrToFunPtr? I want to avoid that because of the warning in the
Haddocks about functions and nonfunctions having differing address ranges (and
possibly sizes?), so the casting might cause problematic behaviour on those
platforms.
…OK, never mind. 🙂
In case anyone else was wondering this, you can just use hsc2hs’s
#peek(etc) to read a field as aFunPtr a, and it Just Works, it seems.