我有这两个错误:
Error:(39, 20) Cannot find an implicit ExecutionContext. You might pass
an (implicit ec: ExecutionContext) parameter to your method
or import scala.concurrent.ExecutionContext.Implicits.global.
val pipeline = sendReceive
^
Error:(39, 20) not enough arguments for method sendReceive: (implicit refFactory: akka.actor.ActorRefFactory, implicit executionContext: scala.concurrent.ExecutionContext, implicit futureTimeout: akka.util.Timeout)spray.client.pipelining.SendReceive.
Unspecified value parameter executionContext.
val pipeline = sendReceive
^
Run Code Online (Sandbox Code Playgroud)
我的代码是:
import scala.util.{Success, Failure}
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.pattern.ask
import akka.event.Logging
import akka.io.IO
import spray.can.Http
import spray.client.pipelining._
import spray.util._
import argonaut._, Argonaut._
object test {
case …Run Code Online (Sandbox Code Playgroud) 我有一个字符串和一个字符串列表,如果lst不包含给定的字符串,或者只是列出'where list'与lst相同,除了删除给定字符串的第一个出现之外,我应该返回任何内容.
allExcept :: [Char] -> [[Char]] -> Maybe [[Char]]
allExcept ch1 chars
| ch1 `notElem` chars = Nothing
allExcept ch [] = []
allExcept ch (x:xs)
| ch /= x = Just(x:(fromJust(allExcept ch xs)))
| otherwise = Just(xs)
Run Code Online (Sandbox Code Playgroud)
我的代码的结果是:不在范围内:`fromMaybe'