Tweak to collective extension syntax
For those keeping track of the new extension methods feature: Martin has just submitted a PR that changes the way you express groups of these extensions. It was previously:
given listOps: [T](xs: List[T]) extended with {
def second = xs.tail.head
def third = xs.tail.tail.head
}
This PR switches that to:
extension listOps of [T](xs: List[T]) with {
def second = xs.tail.head
def third = xs.tail.tail.head
}
As usual, please bear in mind that this is just a PR, far from final. But I think it’s a good change. It better expresses what you intend — to add some extension methods — rather than focusing on the typeclass-centric given
keyword. I think the jury is still out on the use of of
here, but it seems to be a step in the right direction…