Implements Traversable Phase 1 (Tupling)#45
Open
solomon-b wants to merge 7 commits into
Open
Conversation
Owner
Author
|
@masaeedu I'm not sure if this belongs here, cofree-bot, or somewhere else. |
006a2a6 to
3fed6e0
Compare
solomon-b
commented
Jan 23, 2024
Comment on lines
+36
to
+39
| instance (forall x. Profunctor (p x), GTraversable p f g h i) => GTraversable p (M1 _1 _2 f) (M1 _1 _2 g) (M1 _1 _2 h) (M1 _1 _2 i) where | ||
| gsequence :: M1 _1 _2 f x -> p (M1 _1 _2 g x) (M1 _1 _2 h x) (M1 _1 _2 i x) | ||
| -- NOTE: It looks like we need a trifunctor to make this work: | ||
| gsequence (M1 f) = _ $ dimap unM1 M1 $ gsequence @p @f @g @h @i f |
Owner
Author
There was a problem hiding this comment.
Suggested change
| instance (forall x. Profunctor (p x), GTraversable p f g h i) => GTraversable p (M1 _1 _2 f) (M1 _1 _2 g) (M1 _1 _2 h) (M1 _1 _2 i) where | |
| gsequence :: M1 _1 _2 f x -> p (M1 _1 _2 g x) (M1 _1 _2 h x) (M1 _1 _2 i x) | |
| -- NOTE: It looks like we need a trifunctor to make this work: | |
| gsequence (M1 f) = _ $ dimap unM1 M1 $ gsequence @p @f @g @h @i f | |
| instance (forall x. Profunctor (p x), GTraversable p f g h i) => GTraversable p (M1 _1 _2 f) (M1 _1 _2 g) (M1 _1 _2 h) (M1 _1 _2 i) where | |
| gsequence :: M1 _1 _2 f x -> p (M1 _1 _2 g x) (M1 _1 _2 h x) (M1 _1 _2 i x) | |
| -- NOTE: It looks like we need a trifunctor to make this work: | |
| gsequence (M1 f) = _ $ dimap unM1 M1 $ gsequence @p @f @g @h @i f |
It looks like we need a GTrifunctor typeclass
3fed6e0 to
33b24ef
Compare
…al with respect to Tupling
33b24ef to
58f6d17
Compare
58f6d17 to
1eefb9f
Compare
4f66739 to
93a0e28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Special thanks to @isovector for helping write this.