Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!.

Questions tagged [functional-programming]

For questions regarding functional programing concepts like immutability, closures, pure functions, and monads or regarding functional languages which enforce some or all of these constraints.

Score of 0
0 answers
212 views

My programing language aims to be "C with functional programming". Being a fully functional language, it shall satisfy the following properties: It has no mutable variables. It has no ...
Score of 0
1 answer
451 views

OK, maybe a stupid question, I know that quite a few programs have recently been sped up by using Splay Trees instead of self-balancing trees such as Red-Black Trees. But I don't understand how that ...
Score of 5
0 answers
177 views

Does a lazily evaluated language with effect typing exist? Can it exist? It does not seem anyone has published one. Even a very crude research platform would be interesting. Most, if not all, ...
Score of 10
2 answers
1979 views

In the switch statement of imperative languages such as C and JavaScript, the control flow "falls through" to the next case if you don't ...
Score of 4
1 answer
354 views

What's the history and reasoning behind the differences in the typeclass hierarchies in various functional programming language standard libraries? For instance, why does ...
Score of 7
1 answer
536 views

TL;DR This site is of course particularly interested in the language designer's and implementor's perspective so, following What is an arrow and what powers would it give as a first class concept in a ...
Score of 0
1 answer
620 views

Out of curiosity I checked how Google AI would respond to a similar question. The bot seemed clever enough to understand the question, but responded that functions in this case would have no return ...
Score of 6
0 answers
382 views

(While I'm referring to JS in my example, I don't intend to be constrained to JS: so any comments/answers concerning FP-style APIs for working with collections for any language are welcome and ...
Score of 3
2 answers
521 views

Awhile back I wrote a Rust implementation of the Monkey programming language by Thorsten Ball (https://monkeylang.org/). When I got done with it I was a bit surprised that I never used an Arc/Rc ...
Score of 9
2 answers
530 views

I'm trying to understand how to implement corecursion in a total functional context. I've already implemented recursion using standard techniques (for loops) but I ...
Score of 7
2 answers
915 views

While thinking about garbage collection, I realized a simple fact that a garbage collector that is more than reference counting is needed because there are circular references, but there are ...
Score of 1
2 answers
431 views

A lot of C APIs like to have something called bit flags to signal the functions configuration options like Vulkan, OpenCL, SQLite and much more, it a typical pattern to it. This common pattern of ...
Score of 9
7 answers
2022 views

In writing recursive functions (functional style), I often need to refer to the current function (depending on the context). e.g. f 0 = 0 f (S n) = f n + 2 Are ...
Score of 6
3 answers
3461 views

While reading about currying, I found the argument that it is beneficial in languages, which have only functions accepting only one argument. I am wondering how to implement a 2-ary function like the ...
Score of 30
5 answers
5388 views

In Haskell, you can define algorithms by equations that pattern-match on left-hand side constructors. For example: ...

15 30 50 per page