6 Mar
2003
6 Mar
'03
6:58 p.m.
Volker Stolz wrote:
[...] class ToPtr a where toPtr :: a -> Ptr b [...]
The problem with a class like this is that you can't define any sensible instances, apart from the trivial one for Ptr itself. There is no guarantee at all that e.g. a FunPtr, an Int, ... fits into a Ptr and there are actually platforms where this is not the case. It's perhaps OK as a hack, but it has no place in a general FFI library, Cheers, S.