Skip to content

Consider changing the Monoid instance #12

Open
@treeowl

Description

Pretty much everyone hates the Monoid instance for Data.Map. If you're not too terribly opposed to potentially breaking existing code to make future users happy, you can avoid the problem here.

class Semigroup1 f where
  (<<>>) :: f a -> f a -> f a

instance (GCompare k, Semigroup1 f) => Monoid (DMap k f) where
  mappend = unionWith (<<>>)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions