-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
-
[MacOS] copy the entire file (
cat ~/.ghcup/env
) into~/.zshrc
-
ghcup tui
open a GUI to install the rest part, (i
for install;u
for uninstall;s
for set and enable) -
[optional] set
ghcup
mirror: https://mirrors.ustc.edu.cn/help/ghcup.html -
[optional] set
cabal
mirror: https://mirrors.ustc.edu.cn/help/hackage.html#cabal
-
Creating a package: https://cabal.readthedocs.io/en/stable/cabal-package.html#creating-a-package
-
Package install:
cabal install --lib random
-
cabal init
to create a.cabal
file -
touch Setup.hs
and put:#!/usr/bin/env runhaskell import Distribution.Simple main = defaultMain
-
runghc Setup configure --prefix=$HOME --user
: config to user level's repo -
runghc Setup build
: build package -
runghc Setup install
: install package -
ghc-pkg list
: list all installed packages -
ghc-pkg unregister
: remove a package
settings.json
(use ghcup tui
to get ghc
& hls
versions):
...
"haskell.manageHLS": "GHCup",
"haskell.toolchain": {
"ghc": "recommended", // otherwise, use specific version, or "latest"
"hls": "recommended",
"cabal": "recommended",
"stack": "recommended"
},
"haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:$PATH"
},
...
See implicit-hie
cd your-stack-or-cabal-package
stack install implicit-hie # or cabal install implicit-hie
gen-hie > hie.yaml
- compile a single file:
ghc --make capslocker.hs
-
While using GHCI, it might show
libgmp.so: cannot open shared object file: No such file or directory
, and to solve this we canapt install libgmp-dev
. -
libtinfo.so: cannot open shared object file: No such file or directory
:apt install libtinfo-dev
-
Cabal-fmt
installation:cabal install cabal-fmt
-
Learn Me a Haskell: reading notes from "Learn you a haskell" [ link ]
-
Ch01 Introduction
-
-
Learn Real World Haskell: reading notes from "Real World Haskell" [ link ]
-
Ch1 Getting started -
Ch2 Types and functions -
Ch3 Defining types, streamlining functions -
Ch4 Functional programming -
Ch8 Efficient file processing, regular expressions, and file name matching
-
Ch16 The Parsec parsing library
-
Ch17 The foreign function interface
-
Ch19 Error handling
-
Ch20 Systems programming
-
Ch21 Working with databases
-
Ch22 Web client programming
-
Ch23 GUI programming
-
Ch25 Profiling and tuning for performance
-
Ch26 Advanced library design: building a Bloom filter
-
Ch27 Network programming
-
Ch28 Software transactional memory
-
-
Haskell in Depth
-
Ch1 Functions and types
-
Ch2 Type classes
-
Ch3 Developing an application: Stock quotes
-
Ch4 Haskell development with modules, packages, and projects
-
Ch5 Monads as practical functionality providers
-
Ch6 Structuring programs with monad transformers
-
Ch7 Error handling and logging
-
Ch8 Writing tests
-
Ch9 Haskell data and code at run time
-
Ch10 Benchmarking and profiling
-
Ch11 Type system advances
-
Ch12 Metaprogramming in Haskell
-
Ch13 More about types
-
Ch14 Data-processing pipelines
-
Ch15 Working with relational databases
-
Ch16 Concurrency
-
-
Soar with Haskell
-
Production Haskell
-
Effective Haskell