Skip to content

DKISTDC/learn-haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Install GHCUP:

> curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

Make sure ghcup is on your path by running the following. (If not, you need to modify your .bashrc to add ~/.ghcup/bin to your PATH)

> ghcup --version

Install GHC, the "Glasgow Haskell Compiler"

> ghcup install ghc

Install Cabal, the Haskell package manager

> ghcup install cabal

Install Haskell Language Server, which provides LSP support (IDE support for Visual Studio Code, Vim, and others)

> ghcup install hls

Manage installed versions of binaries in a Terminal User Interface

> ghcup tui

Running Haskell Code

Run an interactive REPL outside of a project folder

> ghci
ghci> "hello"
"hello"

Load a local file,

ghci> :load app/Main.hs

Reload loaded files

ghci> :reload
ghci> :r

Run an interactive REPL inside a project folder (like this repository). This will load code dependencies and your Main.hs file.

> cabal repl
ghci> main
ghci> :r
ghci> main

Other useful cabal commands

> cabal run
> cabal build
> cabal test

Editor Integration

(Follow installation instructions first. You should be able to run ghcup, ghci, and cabal in your terminal)

Visual Studio Code

Neovim

Outline

Why Haskell?

  • Code Fearlessly
  • Type System
  • Composition

Lesson 1: Basics

Lesson 2: Lists, Types, and Patterns

Lesson 3: Tuples and Recursion

Lesson 4: Data Types

About

Lesson materials for Haskell Lunches

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published