Skip to content

Intuition for +++ #208

@tusharmath

Description

@tusharmath

Combining two http apps can be done as follows —

val h1: Http[_, _, _, _] = ???
val h2: Http[_, _, _, _] = ???
val h3: Http[_, _, _, _] = ???

val h123 = h1 defaultWith h2 defaultWith h3

// Using operators
val h123 = h1 +++ h2 +++ h3

The way defaultWith works is that when the response of h1 is Empty thats when h2 is executed. Similarly if h2 resolves to an Empty, only then h3 is going to be executed.

The named operator defaultWith makes a lot of sense for this kind of operation, but the symbol equivalent +++ doesn't put across a similar intuition. The proposed operator for this use case IMO should be +>. Thoughts anyone?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs feedbackRequires feedback from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions