Skip to content

-> Solo a functions for lazy maps #1132

Open
@meooow25

Description

@meooow25

I don't know if it comes up in practice, but for lazy maps we can have functions like

insertWith :: Ord k => (a -> a -> Solo a) -> k -> a -> Map k a -> Map k a
unionWith :: Ord k => (a -> a -> Solo a) -> Map k a -> Map k a -> Map k a
...

This gives the caller precise control over which thunk to put in the map.
Right now, with (a -> a -> a) versions, it's always going to be the function application (unless the map operation inlines and simplifies).

I'm not planning to add these right away, but if someone wants them it makes a lot of sense to add them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions