The real landscape of its adoption begs to differ. For the great majority of people, examples and analogies are fantastically more efficient for communicating ideas than building up from first principles. You get to re-use existing mental machinery, intuition, etc, until enough experience has been gained to refine it.
which covers basically all the fundamentals to be proficient in functional programming that has definitions that are opaque and unapproachable. And all of those have very simple examples, both in real life and especially programming. But definition has to come first, or you have this great mass of people that do not understand what they talking about even when they blog about it.
If you can take your time to understand that a type constructor (and take the time to see what it is) and a map function form a pair called functor, you are equipped to learn about monads.
It's not rocket science, but yes, it requires a bit of studying and learning, which is what people don't want to hear, and instead choose the long road of contrived example-driven, inaccurate and confusing blog posts.
(a -> b) -> F a -> F b; the parentheses are critical. I don't fully disagree with your point, but if you're going to emphasize rigor and definitions, it would be wise to make sure you're not setting people on the fence up for mistakes akin to those in the original post.
(You also called it `F` and then used it as `f`.)
The equivalent signature in Java (if we could abstract over type functions) would be:
interface Functor<F<_>> {
<A, B> Function<F<A>, F<B>> map(Function<A, B> f);
}
You'll find very similar in Scala's `cats`, up to some currying and reordering. [0]I wish more FP writers understood that not everyone has the same neurotype, and "easier to understand by reading definitions" is far from a universal statement.
A functor is a PAIR, please notice the emphasis, of a type constructor F and a map function with the following signature: a -> b -> f a -> f b.
Its not a type constructor, it's a pair of two things, the type constructor AND its map function.
Now that we said what it is we provide the usual simple example of Array, Record or Option, show the type constructors and show how we map them.
Is it really so hard to grasp starting from definitions rather than examples and contrived blogs?
I wish people understood that fp is much easier to understand by reading definitions.