In other words, is there a good reason why this shouldn\'t compile? def f(xs: List[Int]) = xs.foldLeft(0) _// OK
Is it possible to do a foldLeft on a list of arguments, where the initial value supplied to the fold is a fully curried function, the operator is apply, and the list is a list of arguments to be passe
I am trying to make an OCaml function that addsthe number of \'a\'s in a string to a given argument.
They don\'t seem to mix that well: abstract class A case class B (var a: Int)(var b: String) extends A case class C extends A
I\'m trying to understand the point of this language feature of multiple parameter clauses and why you would use it.
The uncurry function only works for functions taking two arguments: uncurry :: (a -> b -> c) -> (a, b) -> c
Say you have the following: foo(x: String)(y: Int): Int foo(x: String)(y: Double): Int Scala does not allow such expression. As far as I can see, the reason for this is that foo(\"asdf\") does not
I\'m doing lists concatenation in the following ways (an example, using GHC): myConcat :: [[a]] -> [a]
In Scala one can write (curried?) functions like this def curriedFunc(arg1: Int) (arg2: String) = { ... }
I\'m very new to Haskell and FP in general. I\'ve read many of the writings that describe what currying is, but I haven\'t found an explanation to how it actually works.