While I don't need to use graph based algorithms often, I really wonder if functional is just some big fad, or actually useful.
Like, I tried Haskell, and I tried making some toy algorithms. Factorial here. Some algorithm there. But... it felt terrible. Like, there was zero implicit understanding of whether or not the code would work 100% 10% 1% or .00001% of the speed of a C implementation. It felt like I was just specifying schematic and the "compiler" would become a wizard and magically run the code and if it was fast or slow, was a roll of the dice.
I like how D's API is setup to use method chaining and functional like calls.
Actual code, from dlang.org's example codes:
import std.stdio, std.array, std.algorithm;
// Print all lines of stdin, sorted.
.sort!((a, b) => a > b) // descending order
That's about as self-documenting, clear-intent code you can make in any language!
The really cool thing with D is... you can do most stuff at compile time too. So you can literally (on that same webpage, dlang.org) sort an array, at compile time, with a single call.
I kind of like the D version of functional programming. You can mark any imperative function as pure, and all calls it calls have to be pure as well. That's great for concurrency. You can also use functional snippets where ever you want, without requiring the entire program to be functional. (Or hell, write entirely functional in D, if you want.)
That way, I can use "as much as necessary and no more" functional programming, in the places where I gain a large productivity bonus, and if necessary, replace any slow sections with imperative versions.
But back to functional as a whole. It confuses me. Like, imperative languages bog down when you have to emulate functions. But, functional languages bog down when you have to use imperative logic. "Do this, then this, then this." is the core of 99% of all business logic in the world. So why would I try to map imperative, to functional, just for the sake of "functional"?
I don't know. I know there are lots of different use-cases for programmers. But literally zero of the professional works I've done have involved any need for functional programming and it's been only relegated to "for the sake of itself" or curiosity.