purescript-transformers icon indicating copy to clipboard operation
purescript-transformers copied to clipboard

Add remaining instances for Comonad transformers

Open skeate opened this issue 3 years ago • 5 comments

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)

skeate avatar Oct 13 '22 00:10 skeate

:ping_pong: @garyb

JordanMartinez avatar Oct 17 '22 12:10 JordanMartinez

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:

garyb avatar Oct 17 '22 13:10 garyb

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:

garyb avatar Oct 18 '22 12:10 garyb

Yeah, this is just lifting instances like ask = lift <<< ask in the monadic work, but it's ask = ask <<< lower here :)

MonoidMusician avatar Oct 18 '22 12:10 MonoidMusician

Are we good to merge this btw?

MonoidMusician avatar Nov 11 '22 15:11 MonoidMusician