Giter Club home page Giter Club logo

docker-haskell's Introduction

image


Haskell is a lazy, functional, statically-typed programming language with advanced type system features such as higher-rank, higher-kinded parametric polymorphism, monadic effects, generalized algebraic data types (GADTs), flexible type classes, associated type families, and more.

Haskell's ghc is a portable, optimizing compiler with a foreign-function interface (FFI), an LLVM backend, and sophisticated runtime support for concurrency, explicit/implicit parallelism, runtime profiling, etc. Other Haskell tools like criterion, quickcheck, hpc, and haddock provide advanced benchmarking, property-based testing, code coverage, and documentation generation.

A large number of production-quality Haskell libraries are available from Hackage. The cabal tool fetches packages and builds projects using the Hackage ecosystem.

Contents

This image ships a minimal Haskell toolchain with the following packages (provided by the hvr PPA):

package version
ghc 7.10.1
alex 3.1.4
cabal-install 1.22.2.0
happy 1.19.5

The most recent GHC release in the 7.8 series is also available, though no longer receiving updates from upstream, so users are encouraged to upgrade to 7.10.

package version
ghc 7.8.4
alex 3.1.3
cabal-install 1.20.0.3
happy 1.19.4

Usage

  • Start an interactive interpreter session with ghci:
    $ docker run -it --rm haskell:7.10
    GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
    Prelude>
  • Dockerize a Hackage app with a Dockerfile inheriting from the base image:
    FROM haskell:7.8
    RUN cabal update && cabal install MazesOfMonad
    VOLUME /root/.MazesOfMonad
    ENTRYPOINT ["/root/.cabal/bin/mazesofmonad"]
  • Iteratively develop then ship a Haskell app with a Dockerfile utilizing the build cache:
    FROM haskell:7.8

    RUN cabal update

    # Add .cabal file
    ADD ./server/snap-example.cabal /opt/server/snap-example.cabal

    # Docker will cache this command as a layer, freeing us up to
    # modify source code without re-installing dependencies
    RUN cd /opt/server && cabal install --only-dependencies -j4

    # Add and Install Application Code
    ADD ./server /opt/server
    RUN cd /opt/server && cabal install

    # Add installed cabal executables to PATH
    ENV PATH /root/.cabal/bin:$PATH

    # Default Command for Container
    WORKDIR /opt/server
    CMD ["snap-example"]

Examples

See the application snippet above in more detail in the example snap application.

docker-haskell's People

Contributors

annetheagile avatar christopherbiscardi avatar darinmorrison avatar mfine avatar psftw avatar tianon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.