Answer by Dmytro Mitin for Lazy arguments in lambda
Based on this answer: List.foldLeft(List.reverse(l1), l2)( ((acc, e) => Cons(e, acc)): ((=> List[A], => A) => List[A]) )So you can specify the type of lambda.
View ArticleLazy arguments in lambda
Is it possible to inline the my function in the following snippet?import scala.annotation.tailrecobject Ex14AppendViaFold extends App { val l = List[Int](1, 2, 3, 4) val l2 = List[Int](9, 8, 7, 6) def...
View Article