Take The Haskell Beginners 2022 Course
Written by Nikos Vaggalis   
Tuesday, 22 February 2022

There's a short and free course on YouTube about Haskell and Functional Programming,  taught by a very experienced developer.

And that developer, teacher and enthusiast is Dmitrii Kovanikov, co-founder of KOWAINIK, a small team of enthusiasts who use Haskell and other functional technologies to develop more reliable libraries and tools, as well as a Quantitative Developer at Standard Chartered. Believe me, he knows his craft.

Last year, I had a look at another great and free Haskell course by Professor Graham Hutton from the University of Nottingham in "Free Course On Functional Programming in Haskell" where I explored the connection of Haskell and mathematics :

As Haskell is a purely functional language, when you write a program in it you are in essence writing mathematical functions. It's where a good background in mathematics will help you in programming, something that finally answers the timeless question of whether you need maths in order to program, a topic explored in Does Math Help Programming Or Programming Help Math?.

It starts with the display of some incomprehensible appearing formal mathematical types and majestically demystifies them with simple substitutions.

That's what the essence is. By combating the initial fear that mathematical notations raise and methodically work on them, in the end you'll find that writing in functional style is easier than the imperative.

It just requires an alternative way of thinking. As the quick sorting example demonstrates, in Haskell you do not just work around the algorithm, but you actually capture its essence.

This course is not that mathematically inclined and gets straight to the point from the very first lecture, which after a short intro and high-level overview of the core FP concepts, it jumps straight into explaining Haskell's constructs with the help of GHCi repl:

  • What is Functional Programming?
  • FP concepts
  • Haskell features
  • Haskell toolchain: GHC, GHCi, ghcup, cabal, hls
  • How to install Haskell?
  • GHCi
  • Arithmetic expressions
  • Comparison operators
  • Boolean expressions
  • Calling functions
  • Types
  • :t command in GHCi
  • Types of booleans, numbers and functions
  • Lists and operations with them
  • Prepending, concatenation
  • Standard list functions
  • Ranges
  • Laziness
  • String
  • Syntax constructions
  • Defining our own functions
  • packages, modules, imports
  • if-then-else
  • guards
  • let-in
  • where
  • Immutability
  • Recursion
  • Higher-Order Functions (HOF)
  • Functions as first-class values
  • Lambda functions
  • Partial application
  • mapfilter, etc.

Even if you don't want to learn Haskell, you should at least watch this lecture which goes through Functional Programming's concepts, and is a very helpful introduction:

Lecture 2 is dedicated to data types :

  • Pattern-matching
  • Top level
  • case-of
  • List patterns
  • Recursion and pattern matching
  • Pattern matching pitfalls
  • Totality
  • Tuples
  • Algebraic Data Types
  • Product types
  • Sum types
  • Data types in Haskell
  • data
  • Simple product types
  • Records
  • Enumerations
  • Simple sum types
  • Recursive data types
  • type
  • newtype
  • Polymorphism
  • Parametric polymorphism
  • Types of standard functions
  • Hoogle
  • Polymorphic data types
  • Standard polymorphic data types
  • Eta-reduction
  • Function composition: dot operator (.)

Lecture 3 on Typeclasses focuses on how to write polymorphic functions that works with all data types by making the distinction between parametric polymorphism and ad hoc polymorphism.

  • Parametric polymorphism vs Ad-hoc polymorphism
  • Typeclasses
  • class
  • instance
  • Default methods
  • {-# MINIMAL #-}
  • Small typeclasses vs Big typeclasses
  • Language Extensions
  • {-# LANGUAGE InstanceSigs #-}
  • Standard typeclasses
  • Eq
  • Haskell Equality Table
  • Ord
  • Num
  • deriving
  • Stock derivable typeclasses
  • {-# LANGUAGE GeneralizedNewtypeDeriving #-}
  • Algebraic typeclasses
  • Semigroup
  • Monoid
  • Laws
  • Kinds
  • Functor
  • Folds
  • foldr
  • foldl
  • foldl'
  • foldr vs foldl'
  • Foldable
  • Strict and Lazy evaluation
  • Lazy evaluation
  • Tail Call Optimization (TCO)
  • Equational reasoning
  • {-# LANGUAGE BangPatterns #-}

Lecture 4 is dedicated Monads and IO. Monads is a cornerstone concept of FP that it difficult to visualize and comprehend. Dimitrii is actually doing a good job conveying it through clean code examples.

  • Monad example
  • andThen for MaybeEither and list
  • Monad as programming pattern
  • Monad
  • The typeclass
  • Instances
  • Laws
  • Usage example
  • FAMily: FunctorApplicativeMonad
  • Purity
  • Why Purity + Laziness is a problem for sie effects?
  • IO
  • Why does IO require a monad?
  • String vs IO String
  • getLine
  • putStrLn
  • Main and main
  • Then operator: >>
  • do-notation
  • Cabal
  • Packages
  • build-depends
  • Functional Core, Imperative Shell

The course comes with associated exercises and other material which you can find on its Github repo. 

This is a great opportunity to get started with Haskell. In the end, scientific interest or curiosity aside, what practical benefits would knowledge of Haskell get you ?

Maybe a job in the booming Cryptocurrency job landscape! Take Cardano, for example, whose smart contracts are being written in Haskell. As a matter of fact shortage of Haskell developers is so great that various projects are migrating away from the Cardano blockchain to other platforms because there aren't enough workers:

Africa-focused blockchain internet company 3air has officially abandoned the Cardano blockchain in favor of SKALE, a network powered by Ethereum, after reporting a “massive talent shortage” for Haskell developers.

Shortage means more opportunity for those with the proper skill set, therefore a much larger paycheck! If that isn't a good incentive to learn then what is?

 

More Information

Haskell Beginners 2022 YouTube playlist

Haskell Beginners 2022 GitHub

Related Articles

 Free Course On Functional Programming in Haskell

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


AWS Lambda Upgraded To .NET8 Runtime
25/03/2024

An upgrade of AWS Lambda to the .NET version 8 runtime
brings major improvements to the platform.



We Built A Software Engineer
20/03/2024

One of the most worrying things about being a programmer today is the threat from AI. It has gone so far that NVIDA CEO Jensen Huang proclaims that you really shouldn't start training as a programmer  [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info