Skip to content

Haskell Language

Why Traversable Requires Applicative at Least

At the beginning, the blog name is why traversable requires applicative. However, later I feel like it is nonsense and just repeating the sentence to describe the traversable. It requires applicative of course because it uses that. As a result, I changed blog name because in this blog, we will learn about how the traversable uses applicative and why it requires applicative at least.

You should be familiar with Foldable before reading this blog, and I recommend you to read my previous blog why foldable requires monoid at least

In short, applicative is needed as we need to lift the chosen operator, pure the default value and keep applying by Foldable function foldr.

Throughout Understand Monad Transfomers

Monad transformer(monadt) is another significant concept in Haskell. To understand the monadt, it's compulsory to know how monad works and the mechanism of >>=(bind). Here is the previous blog written by me named throughout Understand Monad.

In this blog, I introduce a requirement of using monad transformer, and then provide a simple example for it. I will try to de-sugar some syntax and explain how the monad transformers stack on the basic monad to help understand monad transformer.

Hs throughout understand monads

Monad is a fundamental concept in Haskell. Recently, I have reviewed them and made my mind clearer. Hence, I wrote down this blog. To understand them, we need to clearly understand some concepts, such as:

  • understand the do notation syntax sugar and learn about how de-sugar it to >>= format
  • understand the closures after de-sugaring
  • type constructor
  • understand how the >>= deals with the data held inside a monad
  • understand the runMonad function properly
  • clarify the difference between monad in category(math) and the monad in haskell

Hs setting up haskell debugger

It's not easy as the other languages which owns an IDE so click the button is the only thing need to do. Using Vscode, I installed several plugins and dependencies, then clicked debug button, oops, nothing happened! The debugger bar flashes and disappear, then nothing happened except the confusing people at the front of screen.

To be frank, I gave up several times when I was attacked by such a messy event. However, another afflict when I want to diagnose my program. After plowing in the troublesome problems, I finally set up it successfully. However, it becomes more messy when I changed my Desktop from Intel to M1, which means I need to set it up AGAIN.

This blog records some hints for setting up Haskell Debugger. I hope I will never set it up with so many trouble again.