Higher-order functions are functions which either take functions as arguments or return them as output (or both). They are a cornerstone of functional programming.
8
votes
2answers
153 views
Functional composition of member function predicates
In C++11, it is en vogue to use small lambda expressions to produce ad-hoc predicates. However, sometimes it's fun to create predicates in a functional, "point-free" way. That way, no function bodies ...
7
votes
2answers
354 views
My first accumulators
Notes
I'm working my way through SICP, and as I got very confused by the section on folds, I decided to try to implement foldr in scheme and javascript to understand how it works differently with ...
6
votes
1answer
117 views
Better or more idiomatic way to apply a sequence of functions in Haskell
This is one of my Haskell solutions to a variation of the N-Queens problem, where the queens can move like knights in addition to their normal moves. It has been optimized somewhat to avoid ...
2
votes
1answer
20 views
Folding with trees
I was trying to implement a foldTree function to generate a balanced binary tree from a list of values using foldr (Question 2 ...