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

Andrew Martin andrew.thaddeus at gmail.com
Fri Oct 26 20:31:11 UTC 2018


The better alternative suggested in this thread is to use Addr instead.
That way, you don't have to lie about the type of the serialized data that
the pointer is pointing to.

On Fri, Oct 26, 2018 at 4:26 PM Sven Panne <svenpanne at gmail.com> wrote:

> 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.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


-- 
-Andrew Thaddeus Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20181026/1c491487/attachment.html>


More information about the Libraries mailing list