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

Relax QFoldable c => QTraversable c superclass contraint #12

Open
echatav opened this issue Mar 21, 2022 · 0 comments
Open

Relax QFoldable c => QTraversable c superclass contraint #12

echatav opened this issue Mar 21, 2022 · 0 comments

Comments

@echatav
Copy link
Collaborator

echatav commented Mar 21, 2022

There are sensible instances for QTraversable that aren't QFoldable, e.g.

data C p x y where C :: p a0 b0 -> C p a1 b1 -> C p (a0,b0) (a1,b1)

qtraverse :: Applicative m => (forall x y . p x y -> m (q x y)) -> C p x y -> m (C q x y)
qtraverse f (C p0 p1) = C <$> f p0 <*> f p1

qfoldMap :: Category q => (forall x y. p x y -> q x y) -> C p x y -> q x y
qfoldMap f (C p0 p1) = f p0 ??? f p1
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

No branches or pull requests

1 participant