Skip to content

++ on Grouped #797

@johnynek

Description

@johnynek

We could handle ++ on Grouped which could merge two Grouped[K, V] together. The trick is to handle cases where they got to be value type V from different starting (K, _) pipes. One trick would be to map the left to Left() and right to Right() before any value mapping. Then lift the value mappings into the Left or Right spaces, then you have Left[L] => Left[V] and Right[R] => Right[V] then you just do fold(identity)(identity) to unwrap both sides onto V, and you're still Grouped.

Alternatively, we could implement .either on Grouped[K, L] , Grouped[K, R] and then ++ can be implemented in terms of that for the case where L == R.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions