Skip to content

Adding custom collection operation which restricts element type of the input collection (documentation needs improving) #1367

@oxbowlakes

Description

@oxbowlakes

The documentation on adding custom operations to collections does not go into any detail about how to add operations to collections of particular element types. As per my stackoverflow question, I don't know how to translate the 2.12 method signature:

def split[X, CC[X] <: Traversable[X], A, B](l : CC[Either[A, B]])(implicit bfa : CanBuildFrom[Nothing, A, CC[A]], bfb : CanBuildFrom[Nothing, B, CC[B]]) : (CC[A], CC[B])

Into 2.13 idiomatic style and implement it. The SO question demonstrates one way I solved the problem using the documentation but it requires type parameters to be supplied at the use-site.

It would be good if the documentation could expressly demonstrate how to solve this sort of thing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions