Skip to content
Examples to accompany the book "Haskell in Depth"
Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
du
expr
ipgen generate full-sized samples Apr 7, 2019
iplookup apply hlint Jan 17, 2019
stockquotes
suntimes
tests
texts examples for chapters 2 and 3 May 22, 2018
.gitignore
.travis.yml fix travis config Oct 13, 2019
ChangeLog.md
LICENSE
README.md
Setup.hs examples for chapters 2 and 3 May 22, 2018
appveyor.yml
dicegame.hs
filecount.hs
gcd.hs
genSQL.hs
hid-examples.cabal
ioref.hs
locator.hs
maybe.hs
package.yaml switch to lts-14.8 Oct 13, 2019
reader.hs
stack.yaml
stref.hs
vocab1.hs examples for chapters 2 and 3 May 22, 2018
vocab2.hs
vocab3.hs hlinting May 23, 2018
weapons.hs add examples from chapter 5 Aug 23, 2018

README.md

This is the sample code to accompany the book Haskell in Depth (Vitaly Bragilevsky, Manning Publications 2019).

To get the source code on your system, you may want to run:

cabal get hid-examples

Alternatively, you may clone GitHub repository with the most current version.

To work with the code on your system, you need either:

Using Stack

Building

stack build

Running

stack exec <executable> [ -- <arguments>]

For example:

stack exec stockquotes -- data/quotes.csv -p -v

Testing

stack test

Exploring in GHCi

stack ghci <module file>

For example:

stack ghci stockquotes/Statistics.hs

Using Cabal sandbox

Building

cabal sandbox init
cabal install --only-dependencies --enable-tests
cabal configure --enable-tests
cabal build

Running

cabal run <executable> [ -- <arguments>]

For example:

cabal run stockquotes -- data/quotes.csv -p -v

Testing

cabal test
cabal test iplookup-test

Exploring in GHCi

cabal repl <executable>

For example:

cabal repl stockquotes

To work with particular module, you have to load it in GHCi with :load.

Using Cabal new-*

Building

cabal new-build

Testing

cabal new-test
You can’t perform that action at this time.