Haskell Language Containers - Data.Map Monoid instance

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Map k v provides a Monoid instance with the following semantics:

  • mempty is the empty Map, i.e. the same as Map.empty
  • m1 <> m2 is the left-biased union of m1 and m2, i.e. if any key is present both in m1 and m2, then the value from m1 is picked for m1 <> m2. This operation is also available outside the Monoid instance as Map.union.


Got any Haskell Language Question?