<div dir="auto">Indeed. I think the point is that Ptr should be thought of as tied to Storable. If you want to use an Addr# for something else, then you shouldn't be using Ptr!</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018, 2:13 PM Evan Laforge <<a href="mailto:qdunkan@gmail.com">qdunkan@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Nov 1, 2018 at 10:47 AM Carter Schonwald<br>
<<a href="mailto:carter.schonwald@gmail.com" target="_blank" rel="noreferrer">carter.schonwald@gmail.com</a>> wrote:<br>
> a good example might be Ptr Char.  Is this a single location of a 32bit / utf32 code point, or an array of utf8 code points or utf32 code points?<br>
> is it null terminated vs there being an extra sequence length? These are all valid things that can be happening. And<br>
<br>
I'm not sure if it affects your point, but I sure hope a 'Ptr Char'<br>
points to a 4 byte haskell Char as it claims, and 'Ptr CChar' points<br>
to a 1 byte C char, as it claims.  Otherwise, sizeOf will be wrong and<br>
array indexing will go out of bounds.<br>
<br>
Of course, in the C case, whether or not there are further chars after<br>
that and if they are terminated and what is the encoding is all<br>
ambiguous, as it always is for C.<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>