I have read that with a statically typed language like Scala or Haskell there is no way to create or provide a Lisp apply
function:
(apply #\'+ (lis
try folds. they're probably similar to what you want. just write a special case of it.
haskell: foldr1 (+) [0..3]
=> 6
incidentally, foldr1
is functionally equivalent to foldr
with the accumulator initialized as the element of the list.
there are all sorts of folds. they all technically do the same thing, though in different ways, and might do their arguments in different orders. foldr
is just one of the simpler ones.