Skip to content

Do Folds without functoriality exist? #4

Description

@considerate

In the paper, def. 3.34. folds are described as optics for the action of foldable functors. However, there is no Functor superclass constraint on Foldable in Haskell.

Unfortunately, while it seems that we can define a category for Foldables, the monoidal category seems to require the functoriality of the objects because otherwise the bifunctor Compose and the bifunctor App cannot be implemented (it might be possible using coercions but I don't know if that forms a proper functor). EDIT: it is not possible to implement either of the bifunctors, even with coercions.

Is there a way to define folds as optics without reaching for functors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions