<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Am Di., 30. Okt. 2018 um 16:48 Uhr schrieb Andrew Martin <<a href="mailto:andrew.thaddeus@gmail.com">andrew.thaddeus@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Look at the definition of SerializedCompact (in ghc-compact):<div><br></div><div>    data SerializedCompact a = SerializedCompact<br>      { serializedCompactBlockList :: [(Ptr a, Word)]<br>      , serializedCompactRoot :: Ptr a<br>      }<div>[...]</div></div></div></blockquote><div><br></div><div>I haven't used the ghc-compact or compact packages yet, so I can't really comment on the details here. The question boils down to: Why does Compact/SerializedCompact have a type parameter at all? Quickly browsing over the Hadoock documentation of both packages doesn't make that clear to me, but as I said: I can't comment on the design decision of someone else's API if I don't fully understand the use cases and tradeoffs involved.</div><div><br></div><div>In any case: This example has exactly *nothing* to do with the proposal at hand. If the API above uses "a" for some good reason/convenience etc. it's perfectly OK, if not, it should better use "Ptr ()" or "Ptr Void". This is perhaps an example of incomplete documentation and/or suboptimal API design, but nothing more. Using Addr here wouldn't improve usability or safety, it would just introduce a non-standard data type for nothing.</div><div><br></div><div>I could show you tons of APIs out in the wild where e.g. lists are used, but where they are actually not really the right data structure for the problem at hand. Nevertheless, this is not an argument against lists per se, this is a problem of the API which abuses them.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>