<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018, 11:28 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><div dir="auto">Pretending we’re talking about this with storable as our example semantics : </div><div dir="auto"><br></div><div dir="auto">Ptr Void </div></div><div dir="auto">Corresponds to a memory address you don’t want to read or write to.</div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This is not so easy to think about (there's not much utility in such a type). Perhaps Ptr Void is a reasonable type for pointers known to be null or outside the address space, but I'm not sure.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br></div><div dir="auto">Ptr () corresponds to a memory location that’s pretty boring to read / write to</div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes! In other words, it's *not* what people should be using for a pointer to an arbitrary non-Haskell address. That's precisely what Addr is for.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 11:22 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com" target="_blank" rel="noreferrer">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><div dir="auto">... when is a valid pointer not going to point at byte addressable memory on memory architectures ghc can support or target? </div></div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 8:27 PM Daniel Cartwright <<a href="mailto:chessai1996@gmail.com" target="_blank" rel="noreferrer">chessai1996@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">Now, one could argue that `Ptr ()` isn't a lie, it sort of reads like C's void pointer. But surely something like `Ptr Word8` is a lie, when it is not actually a Ptr to Word8 values.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 8:11 PM Daniel Cartwright <<a href="mailto:chessai1996@gmail.com" target="_blank" rel="noreferrer">chessai1996@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"><div dir="ltr"><div dir="ltr">yes, only the type and its instances should be moved as far as i'm aware.<div><br></div><div>Also, it's more than just base.</div><div><br></div><div>this Ptr is a lie: <a href="https://hackage.haskell.org/package/ghc-compact-0.1.0.0/docs/GHC-Compact-Serialized.html#t:SerializedCompact" target="_blank" rel="noreferrer">https://hackage.haskell.org/package/ghc-compact-0.1.0.0/docs/GHC-Compact-Serialized.html#t:SerializedCompact</a></div><div>these Ptrs are lies: <a href="https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-IO-Handle.html" target="_blank" rel="noreferrer">https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-IO-Handle.html</a></div><div>in GHC.Stats, the foreign import "getRTSStats" has `Ptr () -> IO ()`, this Ptr () is also a lie</div><div><br></div><div>These are just off the top of my head, there are more</div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 6:46 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com" target="_blank" rel="noreferrer">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">hrmm, what are the pieces of base that are using Ptr when they really should be using Addr? This would help me understand what would be made better in base :) </div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 6:19 PM David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank" rel="noreferrer">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">We shouldn't really need to move anything into base except Addr and its base instances.</div><div class="gmail_extra"><br><div class="gmail_quote">On Oct 25, 2018 5:59 PM, "Carter Schonwald" <<a href="mailto:carter.schonwald@gmail.com" target="_blank" rel="noreferrer">carter.schonwald@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_5831305755901727906m_-2348709952183251237m_7782168492079007908m_1830870421978878534m_7935052445482958367m_4250738866633960983quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">Indeed.  The monad transformer instances for primmonad need to live in primmonad OR transformers to avoid orphans. </div></div><div dir="auto"><br></div><div dir="auto">Either way, unless transformers moves into base (unlikely), no way anything using prim monad will. </div><div class="m_5831305755901727906m_-2348709952183251237m_7782168492079007908m_1830870421978878534m_7935052445482958367m_4250738866633960983elided-text"><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 3:34 PM Andrew Martin <<a href="mailto:andrew.thaddeus@gmail.com" rel="noreferrer noreferrer" target="_blank">andrew.thaddeus@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">I like the idea of moving the type Addr into base. But we cannot move the entire module since it has functions that talk about PrimMonad, and we definitely don't want to move that into base.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 11:25 AM Daniel Cartwright <<a href="mailto:chessai1996@gmail.com" rel="noreferrer noreferrer" target="_blank">chessai1996@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">Motivation: There are a lot of places in base where 'Ptr a' is used in place of 'Addr', because in base there is no 'Addr', only 'Addr#'. The problem lies in the fact that many of these uses of 'Ptr a' are lying; the 'a' value is meaningless. Authors of functions therein have used things like 'Ptr ()', 'Ptr Word8', 'Ptr a', but these types do not mean what they say they mean - they're just Addr. There are probably other motivations for this that I can't think of off the top of my head right now.</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer 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="m_5831305755901727906m_-2348709952183251237m_7782168492079007908m_1830870421978878534m_7935052445482958367m_4250738866633960983m_-301628934586710594m_-5237605456241773259gmail_signature" data-smartmail="gmail_signature">-Andrew Thaddeus Martin</div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</div></blockquote></div><br></div>
</blockquote></div>
_______________________________________________<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>
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div></div>