Why I am Learning Haskell

The Language for the Cardano Blockchain

C. L. Beard
4 min readJan 31, 2022
A green lattice with a light beige background. Each vertice of the lattice has a water droplet hanging from it.
Photo by Clint Adair on Unsplash

Haskell as a programming language has been around for 20 years now, and it has only recently become a language anybody outside of an academic setting would want or try to use. Developed in 1998 by a group of functional programming researchers. Haskell was named after the logician Haskell Curry.

In 2010 the second standard version of Haskell was finalized. As an open-source project development was obviously slow. But the committee kept going with the development of the language.

Haskell was an off-shoot of the Miranda programming language that featured what is called lazy evaluation. What this means is that those parts of a program that are in process are those parts that are evaluated. There is a long history to this and you should read the Wikipedia article to get a better idea of what that all means. There are other reasons that have to do with features that are common to functional programming. I will cover functional programming in a bit.

It is part of Learning to Write Smart Contracts on Cardano

Okay, okay I know that Cardano has for years now been more hype than an actual project. It has just developed smart contract systems development, so it is only recently that you could develop any working programs for the ecosystem. This means there is a lot of opportunity in this ecosystem for those who can take advantage of the potential. It is all new in the Cardano system, and with Solana having trouble with centralization and Ethereum apparently a long way from actualizing all of its potentials. But it is getting there. Going deeper would need a separate article.

If you want to enter a future cohort try here.

It is Functional

The joys of functional programming.

  • pure functions are easier to test and debug, especially testing. Pure functions are easier to reason about.
  • allows parallel processing and concurrency which is good for data analysis and large sets of data
  • programming without side-effects and immutable instances. Side effects are often difficult to track and debug. As far as functional programming goes on Haskell is side-effect free.
  • code can be more condensed and easier to maintain and debug.

Haskell is the purest of functional programming languages. And as such, Haskell programs work as a series of high-level generalized functions that define what the program should do and allow lower layers (compiler, runtime, and libraries) to handle mundane low-level details such as iteration.

It is a General Purpose Language

Haskell can be used for all sorts of projects. It can be used for anything that any other language would be used for unlike something like SQL. You are only limited by your imagination as to what you can do with Haskell. It can be used for WASM development with Asterius.

It is able to be used in any domain case but most likely it is being used and will going forward. It is ideally suited for proprietary business logic and data analysis, fast prototyping, and enhancing existing software environments with correct code, performance, and scalability. The parts of your business that are critical should maybe be developed in Haskell.

Fintech Uses Haskell

From this article

Functional programming languages allow for building stable infrastructures that are fault-tolerant, and fewer errors. Creating a program in Haskell is fast and runs reliably on release. The functional nature of Haskell means production is faster and more reliable. In Fintech Haskell is used for data-processing, transaction-processing-infrastructure, for building reliable blockchain systems, and AI processing too. This all can be accomplished in Haskell. You don’t have to switch languages.

It Will Change How You Think

Many developers feel that after learning Haskell they never really saw the holes in imperative programming in the same way they do now. At Bump, “Bump started out on Python but switched to Haskell after experiencing high errors and spaghetti code that they couldn’t reign in. Jamie Turner, lead developer: “The Haskell compiler provides multiyear life of the code other solutions like Python couldn’t offer while scaling up to support millions of users.” https://www.huffpost.com/entry/haskell-the-language-most_b_4242119

Expressive Type System

The type checking system allows for a type change in one place to be checked and altered in all places within a larger program. The type checker will point out where other changes are needed to get the program completely up to date. In the functional programming world, only Haskell has type checking.

A type system is a logical system that enforces a set of rules on how types are assigned and used in a programming system. This includes variables, functions, expressions, and modules. Types enforce and formalize the system the programmer uses for data structures and other components (Wikipedia).

If you found this article helpful and want to read more why not subscribe to Medium. You can use this link to sign up, and read all you want each and every month. Your membership goes to support writers like myself and others on this platform.

Thank you

--

--

C. L. Beard
C. L. Beard

Written by C. L. Beard

I am a writer living on the Salish Sea. I also publish my own AI newsletter https://brainscriblr.beehiiv.com/, come check it out.

Responses (1)