<div dir="ltr"><div>Relatedly, in an MR I started years ago but never finished, I did some work on the event manager to cut out a bunch of unneeded allocations [1]. This included replacing cons lists in several places with SmallArray. I had to copy in a bunch of code from primitive to do this. The strongest argument I see for moving some of primitive's machinery into base (and then reexporting it in primitive) is that there might be other places in base that could benefit from it. But I'm not certain of what those other places are.<br></div><div><br></div><div>[1] <a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/313">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/313</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 8, 2020 at 9:18 AM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@gmail.com</a>> wrote:<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="auto">This is something I’ve pondered on and off, And the classes PrimMonad and PrimMonadBase are super stable  </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Argument in favor of base : </div><div dir="auto"><br></div><div dir="auto">there’s absolutely code in base, and packages like array, which would benefit from PrimMonad.   Plus it might allow more reuse / encourage more ST monad code in the wild? (I always feel like ST monad is underused. )</div><div dir="auto"><br></div><div dir="auto">Argument against base: </div><div dir="auto">Then a lot of PrimMonad instances would need to live in transformers. And I’m not sure if maintainers over there would want that? </div><div dir="auto"><br></div><div dir="auto">Argument in favor of mtl: it’s where all the other transformer stack stuff gets defined. So all the upkeep for monad instances is already going on there regularly. </div><div dir="auto"><br></div><div dir="auto">Argument against mtl :  aside from concentrating the upkeep on transformer stack instances it seems like it wouldn’t enable new improvements to base.  </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Another option is to have some sort of clone of the class in base , as long as it pays for itself in code reuse / simplification within base</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"><br>-- <br><div dir="ltr" class="gmail_signature">-Andrew Thaddeus Martin</div>