Some things that don’t directly allow functional syntax, but still support a functional style:
-
Underscores.jlgives you better syntax for lambdas,Chain.jlis a similar alternative -
Base.IteratorsandIterTools.jlgive you some lazy evaluation, e.g. when combined withUnderscores.jlyou can write things like
function k_digit_numbers_from_sequence(k, my_sequence_fn)
nums = @_ Iterators.countfrom() |>
IterTools.imap(my_sequence_fn(_), __) |>
Iterators.takewhile(<(10^k), __) |>
Iterators.filter(>=(10^(k-1), __) |>
collect
return nums
end
-
Transducers.jlis an alternative toIterators, inspired by Clojure -
ThreadsX.jlmakes it easy to parallelize functional code, especially withThreadsX.map