Search code examples
haskellsetup-projectscaffoldingcabal

Cabal to setup a new Haskell project?


Is it possible to (ab)use Cabal to have it create a generic Haskell project with a simple command, similar to what you can do in the Scala world with Sbt or Maven?

e.g.

> cabal create AwesomeProject
> ls
AwesomeProject.hs     awesomeProject.cabal     LICENSE     README     Setup.hs 

or is there another tool for that?


Solution

  • Use cabal init --interactive to have an interactive session with cabal. I've pasted the first few questions when using the command:

    arash@arash-ThinkPad-SL510:~/test$ cabal init
    Package name [default "test"]? 
    Package version [default "0.1"]? 
    Please choose a license:
       1) GPL
       2) GPL-2
       3) GPL-3
       4) LGPL
       5) LGPL-2.1
       6) LGPL-3
     * 7) BSD3
       8) BSD4
       9) MIT
      10) PublicDomain
      11) AllRightsReserved
      12) OtherLicense
      13) Other (specify)
    Your choice [default "BSD3"]? 
    Author name? MyName 
    Maintainer email? 
    

    Hope this helps.