<div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 26, 2018 at 4:26 PM Sven Panne <<a href="mailto:svenpanne@gmail.com">svenpanne@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Am Fr., 26. Okt. 2018 um 22:16 Uhr schrieb Daniel Cartwright <<a href="mailto:chessai1996@gmail.com" target="_blank">chessai1996@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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.</div></blockquote><div><br></div><div>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.</div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">-Andrew Thaddeus Martin</div>