Pearls from Haskell #1

Anthony Nandaa
The Andela Way
Published in
2 min readOct 1, 2017
IMAGE CREDIT: Edmond Atto

I recently picked up Haskell (again), just for fun — because life long learning. I’m getting old now, for the young people out there, on top of what you know (most likely Java, JavaScript, PHP, C#, Python, Ruby), I’ll highly recommend that you learn, at least:

  • A System language, e.g. C/C++, Go, Rust, etc (C recommended, you will appreciate the others better).
  • A (pure) functional language, will definitely recommend Haskell!
  • Discrete Mathematics, just the basics.

You don’t have to fully understand (or cover) any of these, leave alone mastering. It’s okay to be confused, you are in good company, me included. It’s part of the learning process.

They will make you a better software craftsman, by giving you a practical way of learning different programming paradigms and shaping how you think as a problem solver:

Languages come and go left and right depending on “what’s popular”. Technology becomes deprecated after months or years depending on what the technology curve is like. (The web deprecates technology at a rate of every 6 months).

Programming technique and Computer Science theory always stays the same.
source

In this series that I’m calling Pearls from Haskell (hereafter referred to as PFH #<number>), I’ll be highlighting stuff from Haskell that give me goosebumps :)

For #1, I’ll start off with list comprehension. What’s impressive about LC in Haskell is how it’s so similar to what you find in your discrete math.

For example:

Mathematical notation for: a set of 2x, such that x is a natural number, and x is equal or less than 10

This will translate to the following in Haskell:

Look out for PFH #2, God willing :)

PS. You want us to buddy up and Learn Us a Haskell together, ping me by adding a “+1” on this Github issue here.

--

--

Anthony Nandaa
The Andela Way

I’m different, just like you / Anti-pattern #Rom122 / Disciple of Jesus Christ / #startups / #teamlead @andela /started @deveint @beyondelabs, et al.