A straightforward way to print debug information in Haskell is with the print function, which takes a value that’s an instance of the Show typeclass and outputs it to the console.
print
Show
To start the GHCi (Glasgow Haskell Compiler’s interactive environment), simply type ghci in your terminal.
ghci
Let’s take a stroll with GHCi, Haskell’s interactive environment that can act as a basic debugger.
Haskell supports various testing frameworks, but two popular ones are Hspec and QuickCheck.
Hspec
QuickCheck