Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • How do you specify the tie-breaker function f here?.
    – Kulu Limpa
    Commented Nov 3, 2014 at 22:56
  • 1
    You mean associative function f: (B, B) => B? If so in this particular case B is Int and Semigroup for numbers already defined in scope by scalaz implicates Commented Nov 3, 2014 at 23:11
  • Yes, I was talking about the associative function; sorry for the confusion. I was just wondering how |+| magically knew what to do in case a key is defined in both maps and how this behavior could be specified. So appearantly you define an implicit val of type Semigroup[B] and override the append function to f. Thanks for the explanation. Your solution is definitively interesting.
    – Kulu Limpa
    Commented Nov 3, 2014 at 23:48