-
Notifications
You must be signed in to change notification settings - Fork 259
[resolves #1333] writer transformer #1850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note that we now have: http://agda.github.io/agda-stdlib/Effect.Monad.Error.Transformer.html |
f4266dc to
79163b5
Compare
|
Very good! I think your changes subsume my |
f68426a to
5384fc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
My main concern is that this gives a blessed implementation
record WriterT
(M : Set w → Set g)
(A : Set w)
: Set (w ⊔ g) where
constructor mkWriterT
field runWriterT : M (W × A)but there are other valid ones, including the CPS-based (cf. this thread for instance)
record WriterT
(M : Set w → Set g)
(A : Set w)
: Set (w ⊔ g) where
constructor mkWriterT
field runWriterT : W → M (W × A)Should we have two modules, one with each implementation?
Maybe in Effect.Monad.Writer.Transformer.FirstOrder vs. Effect.Monad.Writer.Transformer.CPS?
|
Should |
|
Thanks for the link! Looks like the naive version is not that useful from the performance perspective. I agree with making |
0588250 to
3f57858
Compare
|
agda-stdlib/src/Effect/Monad/Error/Transformer.agda Lines 29 to 31 in 7b72307
There was no chance of using it with RawMonadIO which bumps the level.
|
|
This error shows up in the monad/fibonacci test: Bad naming of level variables aside, the error is not illuminating at all. I think it's the same problem as with I doubt Writer is useful in this form without the corresponding lifts. Should I abandon this PR or convert it to draft? |
3f57858 to
67c963f
Compare
|
@gallais do you have any more comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I may have found the source of the error.
67c963f to
8f30207
Compare
|
@gallais are you happy for this to be merged? |
|
Ah sorry @cmcmA20, one last thing! Please could add an entry in the CHANGELOG about the new modules you've added? Then I promise this is merging in 👍 |
add more instances for writer, change output level in RawMonadError
04784d8 to
01214a3
Compare
|
Sorry I forgot about the changelog, fixed now. |
|
Great. Merging now. Thanks again for the great first PR! |
|
No worries, it's my fault for not checking the PR properly before hitting merge. I'll fix it with a |
|
Done. @jamesmckinna could you reopen a clean parity semiring PR please? 👍 (but it might be at the end of the week... deadline/etc. crunch this week...) |
|
OK, checked out a clean branch |
I'm aware of
Data.Sum.Effectful.*but it didn't help me much, I have no idea how to properly organize all the stuff about ExceptT reusing those modules.I'm also asking for tips about improving the current code. First of all I couldn't come up with a really indexed construction for ExceptT because short-circuiting computations mess with the indices. Exceptions can be modeled with
Effect.Monad.Continuationbut is it a good definition for stdlib? Also there's no standard definition of categories in this library so indexed writer as in Bob Atkey's paper is out of reach.