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

Sven Panne svenpanne at gmail.com
Fri Oct 26 17:18:01 UTC 2018


Am Fr., 26. Okt. 2018 um 05:28 Uhr schrieb Carter Schonwald <
carter.schonwald at gmail.com>:

> [...] Ptr Void
> Corresponds to a memory address you don’t want to read or write to.
>

Hmmm, I haven't seen that much in the wild...

Ptr () corresponds to a memory location that’s pretty boring to read /
> write to
>

The intention in lots of APIs is quite different: A "Ptr ()" is a pointer
to some memory of unknown/externally specified format, *and* the consumer
of the API should be forced to insert explicit casts, for whatever reason.
This can be a good idea, but it can be *extremely* annoying, too, it
depends. If you don't want to force casts upon your API users, you use "Ptr
a".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20181026/8f197d3d/attachment.html>


More information about the Libraries mailing list