Haskell

Haskell is a functional programming language. The blog is compiled with Hakyll static site generator to learn Haskell. The Haskell wiki has more information "Why Haskell matters".

Build a debian package with cabal-debian

This article describes steps to build hakyll for debian. It uses libraries from debian repository. This is the preferred method because it uses the debian package repository.

cabal
apt-get --yes install haskell-platform cabal-debian haskell-devscripts ghc cabal-install
apt-get --yes install libghc-hakyll-doc
cd -P "$(mktemp -d)"
hakyll-init hakyll
dh_make -p haskell-hakyll_0.1.0.0 --indep --yes --createorig
cabal-debian
debuild -uc -us

Build hakyll with haskell stack

This method need more time and space because all libraries are recompiled. It works for all platforms with haskell-stack.

hakyll
aptitude install haskell-stack -y
su hakyll -c sh <<-"EOF"
        stack update
        stack setup --no-install-ghc
        stack install hakyll --compiler=ghc-8.0.1
        .local/bin/hakyll-init hakyll
EOF

# cabal update
# stack update --resolver ghc-7.10.3 --stack-root /mnt/tmp/haskell-stack --no-install-ghc
stack update --resolver ghc-7.10.3 --stack-root $OLDPWD/haskell-stack --no-install-ghc
stack solver --resolver ghc-7.10.3 --stack-root $OLDPWD/haskell-stack --no-install-ghc --update-config

stack init --resolver ghc-7.10.3 --stack-root /mnt/tmp/haskell-stack --no-install-ghc
stack build --resolver ghc-7.10.3 --stack-root /mnt/tmp/haskell-stack --no-install-ghc
stack install ghcjs --resolver ghc-7.10.3 --stack-root /mnt/tmp/haskell-stack --no-install-ghc
stack setup --resolver ghcjs-0.1.0_ghc-7.10.2 --stack-root /mnt/tmp/stack/

2> script.tm script -t script.out -c '
STACK_ROOT=/mnt/tmp/stack-root stack setup --resolver ghcjs-0.1.0_ghc-7.10.2
echo $?
'
aptitude install nodejs-legacy
stack setup --resolver ghcjs-0.1.0.20150924_ghc-7.10.2 --stack-root /mnt/tmp/haskell-stack

.stack-work/install/x86_64-linux/ghc-7.10.3/7.10.3/bin/elm make src/Main.elm --no-install-ghc

Build pandoc with haskell stack

This builds pandoc with haskell stack.

pandoc
apt build-dep pandoc
stack install pandoc --resolver lts-9.20 --system-ghc