Explain Haskell like I'm five

I started learning functional programming using python, but I want to level up and I started learning Haskell.

I'm very new in all of this so if you guys can help me explaining it like I'm five, handing me some resources and such, it would be great. Thanks in advance!

Did you find this post useful? Show some love!

Haskell is a language which places a lot of value on the idea that functions should only be able to have effects on the things that they return. In Python, for example, there's nothing to say that calling add(1, 2) won't also change your desktop background to a picture of a unicorn. I mean, it probably shouldn't, but it could. Haskell is designed in such a way that stuff like this isn't possible (or at least, can't be done without you knowing it's happening).

As with any programming style, this has upsides (the flow of data through your program is much easier to understand) and downsides (sometimes you do want to affect the world outside of your function, and it can be a little tricky).

I don't tend to write Haskell very much, but I feel like learning it has changed how I look at code in other languages for the better - it's definitely worth giving it a go!

I'd recommend Haskell Programming From First Principles as a good starting point for learning the language - it's a paid book, but the first 92 pages are free.

Haskell is a language which places a lot of value on the idea that functions should only be able to have effects on the things you pass into them.

Actually, no - functions in Haskell are not able to affect the things that you pass into them. They are only able to affect their own return value.

Whoops, yeah - only affected by the things you pass in, only has an effect on the return value. You're totally right, I'll update my comment.

Like Ben Halpern recommended, Learn You A Haskell for Great Good! was a really good guide for me (and often still is).

Sometimes I think I'm fully into Functional Programming, because coding and reasoning about code is easier with FP than keeping the overview over variable manipulations (and their correct sequence) in imperative programs. I'm really serious. For me, FP is easier.

Explaining like you are five? Not exactly. But:
Programming in Haskell for me is to transform an immutable input to an imutable output. Instead of doing destructive updates of mutable values, piece by piece, hoping I get to a consistent state. Holistic FP vs. atomistic imperative programming.

Easier for me.

As you see, I failed at explaining for 5-year olds, but I hope I could encourage you.

I never got round to finishing it but Learn You a Haskell for Great Good! is a pretty good way to get going. It's a book, but you can read it all online.

Classic DEV Post from Mar 2

On résumés and applying to jobs

Tips for when you apply to a new role

Follow @supernova32 to see more of their posts in your feed.
dev.to is now open source!
View Announcement Post View GitHub Repo
Security engineer, into journalism, privacy and digital rights. Debian ftw,I give speeches, write articles and founded a digital privacy awareness association called Interferencias in Spain.
More from @terceranexus6
Security with Haskell
#security #haskell #functional
Trending on dev.to
Explain Blockchains, Cryptocurrencies Like I'm Five
Who's looking for open source contributors? (August 20 edition)
#discuss #opensource
Explain Grunt Task Runner Like I'm Five
#explainlikeimfive #javascript #discuss
Explain Knowledge Transfer vs Documentation like I'm five
#discuss #explainlikeimfive
How to take breaks while coding
#productivity #learning #career
What are you learning right now?
What's the deal with downing PHP development?
Looking For a Simpler Way To Develop WordPress Themes Locally.
#wordpress #discuss #help