-
怎么用
FoldRight
实现FoldLeft
呢?两个函数的签名如下def foldLeft[A,B]: (List[A], B) => ((B, A) => B) => B def foldRight[A,B]: (List[A], B) => ((A, B) => B) => B
怎么用FoldRight
实现FoldLeft
呢?两个函数的签名如下
def foldLeft[A,B]: (List[A], B) => ((B, A) => B) => B
def foldRight[A,B]: (List[A], B) => ((A, B) => B) => B