Headline

A build tool for Language:Haskell

Illustration

Consider the Hello world program for Haskell:

main = putStrLn "Hello, world!"

Now let's do packaging and build automation for this program. To this end, we set up the following Cabal file:

-- Initial helloWorld.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                helloWorld
version:             0.1.0.0
synopsis:            Demonstration of Cabal
description:         Just filled in to make "cabal check" go quiet.
homepage:            http://101companies.org/wiki/Technology:Cabal
license:             MIT
license-file:        LICENSE
author:              Joe Hackathon
maintainer:          101companies@gmail.com
-- copyright:           
category:            Testing
build-type:          Simple
cabal-version:       >=1.8

executable helloWorld
   main-is:            Main.hs
   other-modules:       
  build-depends:       base ==4.5.*
  hs-source-dirs:      src

As one can see at the top, the initial file was actually generated with "cabal init" such that some parameters are filled in interactively, but a few subsequent modifications were applied to the file manually.

With this Cabal file in place, the program can be built and ran at the command line as follows:

        cabal configure
        cabal build
        dist/build/helloWorld/helloWorld

The configure step checks the Cabal file and resolves external dependencies, if necessary. The build step compiles all involved modules. Thus, an executable can be invoked in the last step.


Ralf Lämmel edited this article at Thu, 30 Apr 2020 20:14:30 +0200
Compare revisions Compare revisions

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.