title: What is correct way to use operator orElse in Scala?
body: <p>I want to write two services, and then use <b>orElse</b> to make the two services combine together, which means service_one or service_two. They are all 
  PartialFunctions.</p>
  
  <p>The service one is:</p>
  
  <pre><code>val usersService = HttpService {
  case request @ GET -&gt; Root / "users" / IntVar(userId) =&gt;
    Ok("test")
  }
  </code></pre>
  
  <p>The service two is:</p>
  
  <pre><code>val versionService = HttpService{
    case req @ GET -&gt; Root / "version" =&gt; {
      val jsonmap = ("origin" -&gt; req.remoteAddr.getOrElse("unknown ip"))
      Ok(compact(render(jsonmap)))
     }
  }
  </code></pre>
  
  <p>and then I want to combine then together.</p>
  
  <pre><code>val service = userService orElse versionService   //the error happens here.
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>[error] F:\workspace\frankcheckAPI\src\main\scala\com\cardaccess\ServiceApp.scala:46: value orElse is not a member of org.http4s.HttpService
  [error]   val service = usersService orElse versionService
  [error]                              ^
  [error] one error found
  [error] (compile:compileIncremental) Compilation failed
  </code></pre>
  
  <p>How to combine then make then works like if case match the first service's path the First service work, if the case match the second service's path. the second service work.</p>
  
  <p>ps: as people concerned:</p>
  
  <p>The HttpService object is define like:</p>
  
  <pre><code>  type HttpService = Service[Request, Response]
    object HttpService {
  
  /** Alternative application which lifts a partial function to an `HttpService`,
    * answering with a [[Response]] with status [[Status.NotFound]] for any requests
    * where the function is undefined.
    */
  def apply(pf: PartialFunction[Request, Task[Response]], default: HttpService = empty): HttpService =
    Service.lift(req =&gt; pf.applyOrElse(req, default))
  ...
  }
  </code></pre>