<div dir="ltr">i agree with carter regarding the Storable-Ptr relationship. It seems to me that Storable is tied to Ptr. Some concrete evidence of this is in the Data.Primitive.Ptr API</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018 at 2:26 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@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">phrased differnetly: storable provides one (c compatible) isomorphism between fixed size values in haskell and c<div><br></div><div>the moment you want to talk about something that isn't fixed sized, like a unicode character (which is a sequence of one or more code points, which we call Char in haskell), storable doesn't apply.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018 at 2:23 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@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">... Ptr *is not* tied to storable, Storable is a convenience for FFI integration .. storable is tied to ptr<div><br></div><div>there are whole MOUNTAINS of haskell code that underly this, and we can't lawyer it away with some opinions</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018 at 2:16 PM David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@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="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" target="_blank">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" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">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>
</blockquote></div></blockquote></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>