higher-order-functions
Calling Scala constructor with multiple argument lists
In Scala, I can create a method that takes more than one argument list: def myMethod(value: Int)(fn: (Int) => Unit) {[详细]
2023-02-28 07:56 分类:问答Use of Clojure macros for DSLs
I am working on a Clojure project and I often find myself writing Clojure macros for DSLs, but I was watching a Clojure video of how a company uses Clojure in their real work and the speaker said that[详细]
2023-02-20 00:46 分类:问答Higher-order functions in Clojure
Clojure is awesome, we all know this, but that\'s not the point. I\'m wondering what the idiomatic way of creating and managing higher-order functions in a Haskell-like way is. In Clojure I can do the[详细]
2023-02-17 01:06 分类:问答Erlang: is it possible to write the minimum function as a list fold?
Given a function: 开发者_运维技巧min(A, B)when A =< B -> A; min(_A, B)-> B. can I use this in the function foldlin a similar fashion to this:[详细]
2023-02-14 20:57 分类:问答Is lambda a type of higher order function?
I saw this question on one of the job postings and its asking what\'s a lambda function and what its relation to h开发者_JAVA技巧igher order function. I already know how to use lambda function but not[详细]
2023-02-11 01:01 分类:问答Why foldl1 fails applying the (==) operator?
From prelude: foldl1: it takes the first 2 items of the list and applies the function to them, then 开发者_开发技巧feeds the function with[详细]
2023-02-09 07:10 分类:问答Output of this program using different scoping/binding rules and parameter-passing?
This is a (really) hard exercise for my next exam. It\'s intended for scoping, binding and parameter-passing rules undestanding. I can\'t figure out even the first 3 numbers outputted, this is driving[详细]
2023-02-04 18:11 分类:问答type of high order functions
if I specify the (I think) correct type for a high order function the OCaml compiler rejects the second usage of that function.[详细]
2023-01-31 03:08 分类:问答Web programming with higher order functions
We are learning higher-order functions in our class and our professor mentioned that they can be useful for web p开发者_JS百科rogramming. I\'m unsure as to what cases in which that would be true and w[详细]
2023-01-25 19:45 分类:问答fold_tree in OCaml
As You may know, there are higher order functions in OCaml, such as fold_left, fold_right, filter etc.[详细]
2023-01-25 10:13 分类:问答