val*_*rry 4 scala list scalaz
我有一个NonEmptyList实例,我想找到(按顺序)与谓词匹配的第一个元素.使用scalas List我可以做myList.find(predicate),但是scalaz NonEmptyList不支持这样的操作,所以这不适用于此.
NonEmptyList
List
myList.find(predicate)
这是为什么?
有没有比做更好的方法myNonEmptyList.toList.find(predicate)?
myNonEmptyList.toList.find(predicate)
Ken*_*ida 5
你可以使用findLeft或findRight.
findLeft
findRight
归档时间:
10 年,2 月 前
查看次数:
526 次
最近记录: