Skip to content

Model Crosswalk laws after Traversable #177

@Icelandjack

Description

@Icelandjack

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions