Add remaining instances for Comonad transformers
Description of the change
Adds ComonadAsk, ComonadEnv, and ComonadTraced instances for StoreT, EnvT, and TracedT
Closes #35
Checklist:
- [x] Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
- [x] Linked any existing issues or proposals that this pull request should close
- [x] Updated or added relevant documentation
- [x] Added a test for the contribution (if applicable)
:ping_pong: @garyb
I did take a look at this, but I don't feel qualified to approve it, since I'm not that familiar with comonad patterns. Perhaps @MonoidMusician or @LiamGoodacre could chime in, I think they're more theorypilled than me? :wink:
Yup, looks good to me! It’s doing the “obvious” thing, which is just the opposite of the usual monadic constructions.
Ah okay. I did once implement some comonad stuff and it seemed way too trivial to be correct. I asked someone and they weren't sure if it was right either. :smile:
Yeah, this is just lifting instances like ask = lift <<< ask in the monadic work, but it's ask = ask <<< lower here :)
Are we good to merge this btw?