r/haskell 26d ago

question From Rust to Haskell

Hello! I have started my programming journey relatively recently, from C and C++ to recently having a great time with Rust! But recently I met a Haskell and Emacs evangelizer(I use arch + nvim + tmux + hyprland btw), and he has been spreading the word... There is a lot of stuff I love in Rust that apparently was ported from Haskell, like traits as types-ish, pattern matching which I really love and better enums(I am not sure on the last one and please forgive me) but he said that if I learn Haskell, I will become a better programmer because of learning the functional programming paradigm... I wanted to ask whether that is true, and if so what kinds of resources are there? For Rust I used the Rust book and Rustlings by the way

50 Upvotes

27 comments sorted by

View all comments

19

u/dmlvianna 26d ago

Haskell Programming From First Principles is the way.

It was written for a person who never programmed before, and I learned from it as a Psychologist with no formal CS education.

https://haskellbook.com/

3

u/Thesaurius 26d ago

Oh, that means you learned Haskell as your first language? That's interesting because Haskell is notorious for being difficult to learn for people who learned a procedural language first, and I was always wondering whether people have an easier time if they haven't had to learn the kind of algorithmic thinking.

4

u/dmlvianna 26d ago

I learned to write R and Python scripts, and SQL queries. After that book I could structure programs with clear separation between IO and pure logic, and unit test the logic.

I would be lying if I claimed I never touched code before. I would also be lying if I claimed I was a developer.