Skip to content

Haskell

Jason Charney edited this page Apr 18, 2016 · 2 revisions

🚧 NEW PAGE!

Haskell is an advaned purely-functional programming language that is declarative and staticly-typed. One of the most notable features about Haskell is its support of [Lambdas](Lambda Calculus).

Haskell is named after logician Haskell Curry, known for the concept in Lambda Calculus known as currying, a technique used for transforming functions in mathematics and computer science, something Haskell does well.

Prerequirements

Haskell likely needs [LLVM and Clang](LLVM and Clang) and

Installation

Haskell has a version of the Glasgow Haskell Compiler (GHC) available from their website prepared for Debian Jessie for the ARMv7 Architecture. The Haskell guys say it is experiemental and that the build is intended for use with the LLVM 3.5 Compiler. This page will help us determine if installing LLVM is absoultely necessary, even if the LLVM guys say that Clang is 3 times faster than GCC.

These instructions will install a binaries, not sources, for ARMv7 archtecture which Pi 2 and Pi 3 support. Downloading it this way will also install the cabal-install package. Documentation is included, which myg explain its almost 200MB size.

$ cd ~/Software
$ mkdir haskell
$ cd haskell
$ curl -SL http://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-armv7-deb8-linux.tar.bz2 | tar xjv

./configure        # This will prepare to put Haskell in /usr/local, unless you define it for elsewhere.
sudo make install  # no make, we can skip to the make install

Here's what I know is installed: ghc, ghci, and haddock. Haskell is ready to roll!

What it didn't install was Cabal, Haskell's system for building and packaging Haskell libraries and programs. What we really should have installed with the Haskell Platform which is a combination of the GHC compiler and core libraries, plus additional tools and libraries covering a range of common programming tasks.

However, you just can't get the Haskell Platform and install it. Oh no. They had to make it complicated. Like the need to install LLVM (which if you have the time and understanding of cross-compilation, you should that from source). The Haskell Platform came with cabel-install-tool, but it did not come with Cabel.

$ cd ~/Software/haskell
$ curl -SL https://www.haskell.org/cabal/release/cabal-1.22.8.0/Cabal-1.22.8.0.tar.gz | tar xvz
$ cd Cabal-1.22.8.0

The README file does contain instructions for just one user and for root. It if it done root style, it applies to any user. We'll do this root style like always so that it is put into /usr/local.

$ ghc -threaded --make Setup
$ ./Setup configure           # Aaaand there is a Segmentation fault. x_x
$ ./Setup build
$ sudo ./Setup install

Hello World

TODO: I really want to add this.

See Also

Links

Setup

  1. [Assemble the Hardware](Assemble the Hardware)
  2. [Install the Software](Install the Software)
  3. 🆙 [Setup your Raspberry Pi](Setup your Raspberry Pi)
  4. [Download the Missing Parts](Download the Missing Parts)

Typical Utilities

  • [Downloading and extracting with curl and tar](curl and tar)
  • [Browsing with ls and cat](ls and cat)
  • [Searching with grep and find](grep and find)
  • [Filtering with sed and awk](sed and awk)
  • [Piping with less, pv, and tee](less, pv, and tee)
  • Monitor your system with htop
  • Multiplex with tmux

Clone this wiki locally