Timeline for How to merge 2 concurrent maps, given an associative function
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 3, 2014 at 23:48 | comment | added | Kulu Limpa |
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.
|
|
Nov 3, 2014 at 23:11 | comment | added | Eugene Zhulenev | 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 | |
Nov 3, 2014 at 22:56 | comment | added | Kulu Limpa |
How do you specify the tie-breaker function f here?.
|
|
Nov 3, 2014 at 22:53 | history | answered | Eugene Zhulenev | CC BY-SA 3.0 |