Should primMonad class live in base or mtl?

Carter Schonwald carter.schonwald at gmail.com
Mon Jun 8 13:17:41 UTC 2020


This is something I’ve pondered on and off, And the classes PrimMonad and
PrimMonadBase are super stable


Argument in favor of base :

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. )

Argument against base:
Then a lot of PrimMonad instances would need to live in transformers. And
I’m not sure if maintainers over there would want that?

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.

Argument against mtl :  aside from concentrating the upkeep on transformer
stack instances it seems like it wouldn’t enable new improvements to base.


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200608/8132b8ad/attachment.html>


More information about the Libraries mailing list