Skip to content

"implementation is left-biased" - but fromList(With) is not #333

@jwaldmann

Description

@jwaldmann

The actual behaviour of fromListWith surprised me, given the general "left-biased" feeling of the library.
I think I was expecting that these be equivalent

fromListWith (++) [ (0,"foo"), (1,"bar"), (0,"oof") ]
unionsWith (++) [ singleton 0 "foo", singleton 1 "bar", singleton 0 "oof" ]

but they are not. Perhaps add a warning in the documentation of fromListWith? Currently, you have to parse the example to infer the semantics.

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