All Questions

1180
votes
22answers
295238 views

What is tail recursion?

Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean exactly?
124
votes
9answers
41451 views

Javascript equivalent of Python's zip function

Is there a javascript equivalent of Python's zip function? That is, given two arrays of equal lengths create an array of pairs. For instance, if I have three arrays that look like this: var array1 ...
423
votes
13answers
91975 views

What is 'Currying'?

I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)
102
votes
11answers
40088 views

Zipping streams using JDK8 with lambda (java.util.stream.Streams.zip)

In JDK 8 with lambda b93 there was a class java.util.stream.Streams.zip in b93 which could be used to zip streams (this is illustrated in the tutorial Exploring Java8 Lambdas. Part 1 by Dhananjay Nene...
52
votes
14answers
18281 views

Cartesian product of multiple arrays in JavaScript

How would you implement the Cartesian product of multiple arrays in JavaScript? As an example, cartesian([1,2],[10,20],[100,200,300]) //should be // [[1,10,100],[1,10,200],[1,10,300],[2,10,100],[2,1...
272
votes
8answers
104480 views

What is Scala's yield?

I understand Ruby and Python's yield. What does Scala's yield do?
506
votes
13answers
415453 views

List filtering: list comprehension vs. lambda + filter

I happened to find myself having a basic filtering need: I have a list and I have to filter it by an attribute of the items. My code looked like this: my_list = [x for x in my_list if x.attribute ==...
298
votes
16answers
77707 views

What is a 'Closure'?

I asked a question about Currying and closures were mentioned. What is a closure? How does it relate to currying?
1121
votes
18answers
222861 views

What is (functional) reactive programming?

I've read the Wikipedia article on reactive programming. I've also read the small article on functional reactive programming. The descriptions are quite abstract. What does functional reactive progr...
1159
votes
41answers
193123 views

What is a monad?

Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is? I have found most explanations I've come across to be fairly inacc...

Previous Next