Skip to content

Add folds #4

@treeowl

Description

@treeowl

There are analogues to foldMap, foldr, and foldl available. The foldMap is particularly pleasant; it's pretty much like the usual one, but maps into a Category instead of a Monoid. The foldr and foldl can be implemented in terms of the foldMap, but I haven't yet figured out how to do so efficiently; direct implementations are not hard though. Let me know if you want me to hack up the code (I've only done it in Idris, for things like Okasaki's implicit deques, but it should be straightforward to translate).

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