
14 Feb
2018
14 Feb
'18
5:16 a.m.
Hi Oleg,
On 14 February 2018 at 09:48, Oleg Grenrus
I agree with Oliver, was just writing the very same.
`Map.map First = Map.map coerce = coerce`
i.e. mapping First is _zero-cost_, thanks to the fact `v` in `Map k v` has represenational role.
Yes, I agree that mapping First is zero-cost. I'm saying that `unionWith (<>)` over the First monoid costs more than `union`, due to allocation of extra thunks. - Akio