Haskell-quick-start
Haskell starter pack with useful pre-set configs.
Note to Windows users
Prefer to use Windows Subsystem for Linux (WSL 2)
https://docs.microsoft.com/en-us/windows/wsl/install-win10
Requirements
GHCUP
install https://www.haskell.org/ghcup/
documentation https://gitlab.haskell.org/haskell/ghcup-hs
For the simple interactive TUI, run:
ghcup tui
Haskell Stack
install https://docs.haskellstack.org/en/stable/README/#how-to-install
https://code.visualstudio.com/
VSCodeExtensions
https://marketplace.visualstudio.com/items?itemName=haskell.haskell
(Windows users with WSL 2) https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl
Test your installation
git clone git@github.com:2jacobtan/Haskell_quick-start.git
cd Haskell_quick-start
stack ghci src/Example.hs
in the GHCi repl:
*Main> helloWorld
[ "Hello"
, "World"
]
*Main>
**
**
everything below is optional
Customization
HLint
https://github.com/ndmitchell/hlint
Suggested usage
HLint usage tends to proceed in three distinct phases:
- Initially, run
hlint . --report
to generatereport.html
containing a list of all issues HLint has found. Fix those you think are worth fixing and keep repeating.- Once you are happy, run
hlint . --default > .hlint.yaml
, which will generate a settings file ignoring all the hints currently outstanding. Over time you may wish to edit the list.- For larger projects, add custom hints or rules.
Miscellaneous Recommendedations
Hasklig
a coding font with ligatures designed for Haskell
https://github.com/i-tu/Hasklig/releases/tag/v1.2
VSpaceCode
Spacemacs like keybindings for Visual Studio Code
pretty-simple: pretty printer for data types with a 'Show' instance
https://hackage.haskell.org/package/pretty-simple
Learning
Haskell via Sokoban, by Joachim Breitner
https://haskell-via-sokoban.nomeata.de/
This Haskell tutorial is based on the 2016 installment of the CIS194 Haskell course at the University of Pennsylvania, and encompasses the first four lectures. What’s interesting about sessions is that they start teaching the very basics of Haskell using the CodeWorld online programming environment, so you can get started right away.
I have moved these lectures here partly because the CodeWorld API changes over time, so some of the examples on the CIS194 website stopped working. This only affects lectures 1–4, so if after working through the present document, you can right away start with lecture 5 (“Real World Haskell”). But before that, enjoy this introduction.
This material was inspired by and builds on the content of the previous installments for the CIS194 courses, held by Brent Yorgey, Richard Eisenberg and Noam Zilberstein. You can view the source on GitHub of this document, and submit improvements there.
Get Programming with Haskell, by Will Kurt
https://www.manning.com/books/get-programming-with-haskell
(free to read online)