Functional programming is a programming paradigm where programs are constructed by applying and composing functions.

Setup

Setting up the development environment for the module.

  1. Install GHCup (https://www.haskell.org/ghcup/install/)
  2. Follow the instructions and answer the questions to finish setup
  3. Install Visual Studio Code
  4. Install the Haskell Extension Pack

Haskell

The Glasgow Haskell Compiler (GHC) has an interactive command-line interface called GHCi. This REPL can be used to test code and functions in addition to showing useful debug information.

A list of useful GHCi commands:

  ghci <filename>         # start GHCi and load contents of <filename> into runtime (optional).
ghci> :r                # reload file(s) provided on session start
ghci> :set              # list options which are currently set
ghci> :set +<option>    # enable <option> (e.g. :set +t prints type after each evaluation)
ghci> :t <expression>   # print type of <expression>
ghci> :q                # quit GHCi