博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Scalaz迭代:“提升”`EnumeratorT`以匹配`IterateeT`为“更大”的monad
阅读量:2380 次
发布时间:2019-05-10

本文共 1036 字,大约阅读时间需要 3 分钟。

本文翻译自:

If I have an EnumeratorT and a corresponding IterateeT I can run them together: 如果我有一个EnumeratorT和一个相应的IterateeT我可以一起运行它们:

val en: EnumeratorT[String, Task] = EnumeratorT.enumList(List("a", "b", "c"))val it: IterateeT[String, Task, Int] = IterateeT.length(it &= en).run : Task[Int]

If the enumerator monad is "bigger" than the iteratee monad, I can use up or, more generally, Hoist to "lift" the iteratee to match: 如果枚举器monad比iteratee monad“更大”,我可以用up或者更常见的是,使用Hoist “提升”iteratee以匹配:

val en: EnumeratorT[String, Task] = ...val it: IterateeT[String, Id, Int] = ...val liftedIt = IterateeT.IterateeTMonadTrans[String].hoist(  implicitly[Task |>=| Id]).apply(it)(liftedIt &= en).run: Task[Int]

But what do I do when the iteratee monad is "bigger" than the enumerator monad? 但是当iteratee monad比枚举器monad“更大”时,我该怎么办?

val en: EnumeratorT[String, Id] = ...val it: IterateeT[String, Task, Int] = ...it &= ???

There doesn't seem to be a Hoist instance for EnumeratorT , nor any obvious "lift" method. 似乎没有EnumeratorTHoist实例,也没有任何明显的“提升”方法。

转载地址:http://pfexb.baihongyu.com/

你可能感兴趣的文章
面向对象设计基本原则
查看>>
Redis数据库篇 -- 事务
查看>>
hadoop 完全分布式环境搭建
查看>>
HDFS 回收站
查看>>
hadoop 完全分布式HA高可用集群(手工切换)搭建
查看>>
hadoop 完全分布式HA高可用集群(自动切换)搭建
查看>>
Hbase shell常见命令
查看>>
看看这同一句sql,scan index占用的资源大了很多!!
查看>>
couldn't set locale correctly报错解决
查看>>
回收基表的空间,造成物化视图只刷新了一部分数据
查看>>
ORA-12052,不能建立快速刷新物化视图的解决
查看>>
物化视图comlete刷新会产生大量的日志
查看>>
Mysql cluster slave server的自动检测与修复
查看>>
solaris同步时钟
查看>>
mysql升级
查看>>
V$sql_text v$sqlarea v$sql 的区别
查看>>
Redis 集群功能说明
查看>>
linux 下 free的用法
查看>>
oracle11gR2在RedHat5上前期安装配置脚本
查看>>
sar的用法
查看>>