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

Model Crosswalk laws after Traversable #177

Open
Icelandjack opened this issue Oct 7, 2022 · 0 comments
Open

Model Crosswalk laws after Traversable #177

Icelandjack opened this issue Oct 7, 2022 · 0 comments

Comments

@Icelandjack
Copy link

This are just preliminary thoughts, but Crosswalk (with respect to Align) is not quite like Traversable (wrt Applicative).

The laws of Traversable target specific Applicative-instances, namely Identity and Compose f g:

  • Identity: traverse Identity = Identity
  • Composition: traverse (g <%< f) = traverse g <%< traverse f

given this graded composition operator:

(<%<) :: Functor f => Functor g => (b -> g c) -> (a -> f b) -> (a -> Compose f g c)
g <%< f = Compose . fmap g . f

The laws of Crosswalk however just mention crosswalk (const nil) = const nil but maybe it can be written similarly? I'm curious what you think:

  • Identity: crosswalk (const Proxy) = const Proxy
  • Composition: crosswalk (g <%< f) = crosswalk g <%< crosswalk f
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