小编kam*_*imo的帖子

找不到隐式ExecutionContext.你可能会通过喷雾scala

我有这两个错误:

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)

scala spray-json argonaut spray-client

10
推荐指数
1
解决办法
1万
查看次数

不在范围内:`fromMaybe' - haskell

我有一个字符串和一个字符串列表,如果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'

haskell maybe

3
推荐指数
1
解决办法
2543
查看次数

标签 统计

argonaut ×1

haskell ×1

maybe ×1

scala ×1

spray-client ×1

spray-json ×1