Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 433
Alexander Battisti Avatar asked Apr 27 '11 13:04

Alexander Battisti


People also ask

Where are Haskell packages installed?

If you don't need a fully partitioned GHC environment and are happy with the installed versions on DICE, cabal might be the simplest way to install the Haskell packages you require. By default stack installs packages to ~/. cabal and ~/. ghc in your home directory.


1 Answers

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.

like image 86
Tarrasch Avatar answered Oct 17 '22 20:10

Tarrasch