Skip to content
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

Implements Traversable Phase 1 (Tupling) #45

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

solomon-b
Copy link
Owner

@solomon-b solomon-b commented Jan 23, 2024

Special thanks to @isovector for helping write this.

@solomon-b solomon-b requested a review from masaeedu January 23, 2024 06:18
@solomon-b
Copy link
Owner Author

@masaeedu I'm not sure if this belongs here, cofree-bot, or somewhere else.

@solomon-b solomon-b force-pushed the solomon/hkd-traversable branch 3 times, most recently from 006a2a6 to 3fed6e0 Compare January 23, 2024 07:24
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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@solomon-b solomon-b self-assigned this Jan 24, 2024
@solomon-b solomon-b force-pushed the solomon/hkd-traversable branch from 3fed6e0 to 33b24ef Compare January 24, 2024 21:29
@solomon-b solomon-b changed the title Implements Bifunctor.Traversable Phase 1 (Tupling) Implements Traversable Phase 1 (Tupling) Jan 26, 2024
@solomon-b solomon-b force-pushed the solomon/hkd-traversable branch from 33b24ef to 58f6d17 Compare February 5, 2024 07:04
@solomon-b solomon-b force-pushed the solomon/hkd-traversable branch from 58f6d17 to 1eefb9f Compare February 5, 2024 07:09
@solomon-b solomon-b force-pushed the solomon/hkd-traversable branch from 4f66739 to 93a0e28 Compare February 6, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant