Proposal: Move primitive-Data.Primitive.Addr API into base

Sven Panne svenpanne at gmail.com
Fri Oct 26 20:26:28 UTC 2018


Am Fr., 26. Okt. 2018 um 22:16 Uhr schrieb Daniel Cartwright <
chessai1996 at gmail.com>:

> I am referring to the situations when someone uses 'Ptr a', but the Ptr
> does not point to anything of type 'a'. If I write 'Ptr Word8', but I am
> pointing to a Char, then that is not true.
>

It might not be true, but you might be forced to do such things to use some
ugly C library. The Ptr type carries some valuable information, namely:
What does my C counterpart expect? It might not be 100% true on the Haskell
side, but you are in "unsafe land", anyway, and at some level you *have* to
be able to use some white lie when necessary. Note that I'm not saying that
this is nice, but I haven't heard of a better alternative yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20181026/f4b93dc2/attachment.html>


More information about the Libraries mailing list