Introduction to Haskell by Paweł Szulc

Introduction to Haskell

Introduction

“Introduction to Haskell” is an intense two-day workshop intended to teach attendees the Haskell programming language. Over thirty years old, Haskell is one of the most mature platforms available in our young industry., It represents the  state of the art in Functional Programming, incorporating the cutting-edge research and ideas as new features in the language. Since its introduction, the language  has consistently attracted the attention of each new generation of programmers.


Haskell has also become  the lingua franca of the academic Functional Programming community. It is hard to find a paper about Functional Programming written in the last twenty years that does not include code examples written in Haskell. The language has proved its strengths in many fields, including finance, web startups, and hardware design.  It is also currently gaining quite a bit of traction in the blockchain industry. With its gaining popularity and powerful features, it’s rapidly becoming a “must-learn” language.

 

Relevancy

Alan Perlis, one of the founding fathers of our industry, once said "A language that doesn't affect the way you think about programming is not worth knowing". Haskell is probably quite unlike  any language you have used in the past, especially if your background is in one of the so-called “C-like languages” (C, C++, Java, Ruby, Javascript). And yes, learning and using Haskell becomes an addiction that will affect the way you think about and  write software. So even if you don’t have the chance to use it on daily basis, it will influence the style, clarity, expressiveness and overall robustness of your code. You will become a better software engineer by learning Haskell. It will teach you to think and code in a different style which will start infect your daily practices before you know it. You will truly experience what it means to stand on the shoulders of giants. Incorporating 30 years of academic and industrial research into your toolkit, will help make your code easier to reason about and maintain.  It will help you architect more robust, extendable designs which can be easily adapted to to changing requirements.

Benefits

Reading about Haskell might give you impression that you are learning the language, but real learning only happens when you apply the language’s concepts to real working program . As Dennis Ritchie once said, "The only way to learn a new programming language is by writing programs in it". In this intense workshop you will not only learn about the Haskell language, but you will have plenty of opportunity to use it. We will write a huge amount of code, as that proves to be the most effective way of learning. We will start slow, explaining basic syntax language, its standard structures, and builtin features. After that, we will jump into more advanced topics, learning to recognize some of the of the well-known and patterns like Functors, Applicative Functors, and Monads. Each exercise will build off the topics covered , as we slowly build working software based in Haskell. If all goes well, we will set our sights higher, and aim to complete a working app by the end of the workshop

Concepts and skills

Attendees will learn the following concepts:

  • Functions, function calls, lazy evaluation, operators, higher order functions

  • Let and where clauses

  • Basic data structures, lists comprehensions, tuples, ranges

  • Types, type variables, polymorphism, type inference

  • Typeclasses 101 (e.g Eq, Show, Ord), typeclass derivation

  • Pattern matching, guards

  • Algebraic data types, Record syntax

  • Typeclasses 201 (e.g Functor, Applicative, Monad, Semigroup, Monoid, Foldable, Traversable)

  • Typeclasses 202 (Writer, State, Reader)

  • Monad transformers

  • Introduction to MTL/Tagless Final Encodings

  • (optional) Putting it all together - creating an app


We will be using Stack to build our projects into executables. The workshop will also include an  introduction to Stack.


Prerequisites

Attendees should bring their own computers with Haskell and Stack preinstalled. Instructions will be provided week before the training on how to install the above.

Attendees should use whatever text editor / IDE they feel most comfortable with. A mode that supports Haskell syntax highlighting is not essential but will help a lot. We also recommend an editor that supports integration with ghci. Emacs and vim users should consider “Intero” mode / plugin.


Instructor Bio

Pawel Szulc is a senior engineer at Pyrofex. He has  more than 4 years of experience working on purely functional code bases. He is currently Scala developer by day, Haskell enthusiast by night. He has been an active member of Scala community for quite a few years now, defending its functional nature. His heart will always be with Haskell - the language that pushes the frontier of engineering practices and good software development.