Skip to content

Intuition for +++ #208

Closed
Closed

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?

Activity

  1. added
    needs feedback
    on May 16, 2021
  2. locked and limited conversation to collaborators on Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs feedback

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions