Closed Ericson2314 closed 5 years ago
Thanks @aherrmann. I'm quite willing to add all the docs you or anyone wants for these changes; I definitely agree these changes are quite surprising up front for people used to the MTL/seeing Writer
as an atom of capability. You may want to look at #63 for all the discussion that this has generated so far.
Writer
is a funny thing in that it almost doesn't need the Monoid constraint at all. pass
, for example, could work by mapping the function on each tell argument, rather than after they've been mappend
ed together (the laws here permits either). It's just listen
which, in containing a runWriterT
or it's moral equivalent), speaks to how the effect is eliminated thus forces the Monoid.
My view is sort of syntactic. yield
/tell
alone cannot speak to whether the garbage chute ends in a monoid trash heap or conveyor belt for further processing :). If I write code using just that one method/capability, I wish my code to be open to as many possible interpretations as possible.
@Ericson2314
I'm quite willing to add all the docs you or anyone wants for these changes;
Thank you! Yes, I think this is a good addition to capability
. I'll be happy to merge it with some more docs.
OK added some documentation.
@Ericson2314 Sorry for leaving this hanging for so long. Thanks for the added documentation! Looks good to me.
I noticed that the examples needed fixing. I added the corresponding changes.
Oh, right. Thanks for fixing those!
Does the good half of #63.
I went ahead to give that idea a spin, and found a few interesting things in the process. Will comment in line notes.