Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Scala中将scalacheck Gen与Future结合起来_Scala_Monads_Future_Scalacheck_Scala Cats - Fatal编程技术网

在Scala中将scalacheck Gen与Future结合起来

在Scala中将scalacheck Gen与Future结合起来,scala,monads,future,scalacheck,scala-cats,Scala,Monads,Future,Scalacheck,Scala Cats,基本上,我正在尝试生成HTTP请求的结果生成器,因此,我通常会得到类似Gen[EitherT[Future,Error,T]]的类型 问题是,似乎没有任何一元实例(因此我可以使用序列,或单元变换器)让我组成Gen[EitherT[Future,Error,t]] 例如,假设我们有以下函数 def genUser:Gen[EitherT[未来,错误,用户]] 及 def genAccounts(用户:用户):Gen[EitherT[Future,Error,List[Account]] 其思想是能

基本上,我正在尝试生成HTTP请求的结果生成器,因此,我通常会得到类似
Gen[EitherT[Future,Error,T]]
的类型

问题是,似乎没有任何一元实例(因此我可以使用
序列
,或单元变换器)让我组成
Gen[EitherT[Future,Error,t]]

例如,假设我们有以下函数

def genUser:Gen[EitherT[未来,错误,用户]]

def genAccounts(用户:用户):Gen[EitherT[Future,Error,List[Account]]

其思想是能够正确地组合
Gen[EitherT[Future,Error,T]
类型,以便
genAccounts
调用
genUser
,例如

def genAccounts(用户:用户):Gen[EitherT[Future,Error,List[Account]]=for{
用户