Why Learn Haskell? The Language Of Logic And Decentralization

Lucas Thinnes
3 min readJul 8, 2021

With Haskell appearing in many different contexts in and around the programming world, including Cardano choosing to develop its blockchain technology in Haskell, many may ask what the benefit of learning to write in this language may be, or any language that isn’t JavaScript or Python for that matter. Let’s start off by understanding exactly what this language is all about: Haskell is a purely functional, strongly typed, lazily executed, expressive, high-level programming language. By purely functional we mean its functions are unable to observe anything beyond its inputs, by strongly typed we mean enforcing restrictions on the intermixing of data and types, by lazily executed we mean nothing will happen until an action is triggered, by expressive we mean it has the ability to define and write new methods without typecasting, and by high-level we mean it is closer to reading & writing in English than in some austere and cryptic language. Now we must ask, how is ANY of this relevant or pivotal in developing our skills as developers?! Let’s break it down.

THE BENEFIT OF PURE FUNCTIONS

Haskell is acknowledged as the “purest of all functional programming languages”. Purity makes deciphering code much easier as it sets limitations to what you know functions are able to do. As the functions will not have access to the outer scope, this makes working within the parameters of a pure function a more deliberate act and more concretely focused on the logic of functions. More can be read about the benefits of pure functions here.

THE BENEFIT OF STRONG TYPING

In my article on TypeScript, I wrote about the benefits of receiving “instant feedback”, or becoming aware of bugs in code before compiling or running the application. Generally, errors will make themselves evident through red underlines beneath the erroneous code (much like a typo). This saves time and energy as having to console.log every single element in your app to figure out what is wrong is an extremely taxing endeavor (anybody who works with JavaScript can agree). There is also the ability to improve more drastically as seeing these errors immediately will train the mind more effectively to not repeat the same mistakes, thus turning you into a productivity machine.

THE BENEFIT OF LAZY EXECUTION

Language which feature compilers with lazy execution have many benefits, and most of them are within the domain of efficiency. If there is a function which is written what accepts two arguments and within the function only one is referenced or modified, the compiler will not bother doing anything with the argument which is not referenced at all. Additionally, learning about the efficiency of code is something that will really impress potential employers!

THE BENEFIT OF EXPRESSIVE AND HIGH LEVEL LANGUAGES

This one is a bit self explanatory as expressive languages are easier for the reader and writer to understand! When working in group environments or in situations where there will be multiple people looking at your work (as you will be looking at theirs) expressive languages make for less confusion and more transparent communication of ideas and functions.

THE BENEFIT OF NOT LEARNING HASKELL?

It is worth mentioning that there is a steep learning curve associated with learning Haskell, which is generally the reason as to why it has less popularity in the functional programming world. However, it is credited as being one of the most important languages to learn in order to grow as a developer, and besides, who got into programming to avoid the state of being challenged?

--

--