Haskell & The Fallible Human Mind
Haskell is not, and never was, for genius; it is for the fallible.
The thesis of my article may surprise the uninitiated because the languages that fall within the ambit of “functional and pure” and “strong, static, inferred typing” have an aura of advanced intellectualism. This aura dissipates as understanding is gained, in most cases, and I attempt in this article to dispel the Myth of Haskell by relating the language’s intentions to an attribute all programmers have: fallibility.
Advanced intellectualism is the picture most programmers have of Haskell, and it comes in two parts, because the language designer’s use of upstream academic research (Category Theory, I’m looking at you) to refine and innovate on the language also suffuses, to a degree, many of the cultural idioms of Mathematics and academic language researchers. It also means that the process of writing a program is dramatically different from the mainstream, that is the second part.
I often find it’s the acculturation that scares most of my friends away when approaching Haskell and not purity, or bounding of effects, or figuring out the Type System (because once they get past the name, monad, the meaning is natural). The latter I will write about in a moment.
I don’t think the syntactic naming of objects in Haskell should change in response to this inherited culture, it’s important for the names of things to be representative of their qualities or modalities, but I do think the blow people’s psyches receive when first encountering a monoid or functor must be softened and the culture of the language more human-relatable (I’m attempting a bit of that here).
The other qualities beyond acculturation: referential transparency, the rigid type system, immutable memory, etc… are all qualities of the language people get frustrated over.
Programmers approaching from environments that do not explicitly enforce clear, coherent excogitation tend to feel psychological shock and denial from the Type System’s straight-jacket, pushing their reactions into ego-preservation. The straight-jacket is always there in every Turing-complete context but what Type Systems characterized by Haskell and kin are doing is circumscribing what the boundaries of that jacket are; enforcing for our sloppy and creative human minds the explicit formulation of thought.
This is typically where the frustration starts. Other than better tutorial materials from library authors, which IS seeing an improvement, this frustration stage is the paradigm shift beginning to dawn on the learner. The only way to soften that is to remember that it’s always this way when learning something that you do not have analogies or metaphors to draw upon for understanding.
The good intentions of the language designer are paradigm-jarring enough, to make a programmer feel like a layman in his own environment! That’s also the cause of some frustration but it’s also not for a wasteful end, it’s for a productive and safer end.
Haskell, as an advanced language, isn’t something unreachable or something for the geniuses and intelligentsia. The intention is rooted in pragmatism, self-awareness of human cognitive limits, and efficacy for the craftsman. I want to revoke that word, advanced, and replace it with the word “innovative”.
Humans are fallible and the best proof of our elevation from the mundane is the self-awareness that we need help from our own creations. Haskell is innovative and if you are on the fence about learning something that will expand your ken and your craft than I hope this short piece inspires you to move forward and risk your comfortability :)
Oh! I almost forgot. There’s another facet to that “advanced” ambiguity and it’s the perception of haughtiness; a result of the promulgation of Haskell as a difficult language by enthusiastic programmers. Programmers who’ve overcome the learning curve and confuse their message with the desire to feel recognition for their hard-won knowledge and the desire to see their peers also uplifted by that knowledge. I’m qualified to say that because I’m guilty of having embodied, at one time, The Young Haskell Enthusiast.