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
This are just preliminary thoughts, but
Crosswalk(with respect toAlign) is not quite likeTraversable(wrtApplicative).The laws of
Traversabletarget specificApplicative-instances, namelyIdentityandCompose f g:traverse Identity = Identitytraverse (g <%< f) = traverse g <%< traverse fgiven this graded composition operator:
The laws of
Crosswalkhowever just mentioncrosswalk (const nil) = const nilbut maybe it can be written similarly? I'm curious what you think:crosswalk (const Proxy) = const Proxycrosswalk (g <%< f) = crosswalk g <%< crosswalk f