From Scala to Haskell

A detailed comparison between the programming languages language and Haskell by presenting equivalent code.

@riiswa

If you like the advanced functional aspects of Scala, you’ll probably like Haskell, a programming language that was a big inspiration for Scala. In order to make the transition to Haskell easier, I will present here a series of “equivalent” codes.

We will use Scala 3 without functional libraries (Cats, Scala ZIO, Scalaz…) and Haskell 2020. I will often use examples from the excellent book Learn You a Haskell for Great Good! by Miran Lipovača which has helped me greatly in my transition

Note that this guide is not intended for learning these languages but for Scala developers who are already familiar with the Haskell language. Finally, feel free to contribute to this page via the Github. Enjoy your reading!

println("Hello World!")
putStrLn "Hello World"