Learn-you-a-Haskell-for-great-good

What do you need, to “dive” in? 🤿

  1. Text editor; 📝
  2. “Haskell” compiler. 🤖

№ 1️⃣. Text editor 📝

You (probably) already have your favorite text editor installed – so we won’t waste time, on that! ⚡ ⏳

№ 2️⃣. “G.H.C.” 🤖 : «Glasgow’s Haskell compiler»

For the purposes of this tutorial – we’ll be using the “G.H.C.” (the most widely used “Haskell” compiler). The best way to get started – is to download the “Haskell” Platform (which – is (basically) “Haskell” «with batteries included»). 🔋🔋🔋

Usage; “interactive” mode 🏓

“G.H.C.” – can take a “Haskell” script (they (usually) have an “.hs”-extension) – and compile it 📜; but it (also) has an interactive mode – which allows you to “interactively interact” with scripts, interactively … 📝

You can call functions (from scripts, which you load) – and – the results are displayed immediately! ⚡ … For learning 🎓 – it’s a lot easier (and faster), than recompiling every time, when you make a change (and then – “running” the program, from the prompt).

№ 1️⃣. Invoking the mode ✨

The “interactive mode” – can be invoked by typing in «ghci», at your prompt. ⌨

№ 2️⃣. Loading files 📂

If you have defined some functions (in a “file” called (say) «myfunctions.hs» 🗄):

Usual workflow 💡

The usual workflow (for “me”, when playing around in stuff) – is:

This – is (also) what we’ll be doing, here.