
We've expanded the wiki page on 'How to write a Haskell project', to include a complete walkthrough creating: * Darcs * Cabal * QuickCheck infrastructure. http://haskell.org/haskellwiki/How_to_write_a_Haskell_program Feedback welcome! -- Don P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.

Quoth Donald Bruce Stewart, nevermore,
P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.
I was wondering about that just the other day. Is there such an
application to interrogate the user about particulars and then create a
fully compliant *.cabal file?
D.
--
Dougal Stanton

On 11/19/06, Dougal Stanton
Quoth Donald Bruce Stewart, nevermore,
P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.
I was wondering about that just the other day. Is there such an application to interrogate the user about particulars and then create a fully compliant *.cabal file?
I'm unaware of such a tool, but as far as UIs go, it should be fairly straight forward. It would be nice to have both a text mode and a GUI version. This would make an excellent project for someone just starting in Haskell who wants to make life easier for everyone (a great way to get some fame in the community). I'm imagining the tool looks at your darcs repository, asks you a few questions and then generates a .cabal file. Considering that the basic cabal file is about 10 lines or less, not counting the list of source modules, it's almost not worth writing. On the other hand, even as simple as the .cabal files are I always have to copy an existing one or check the manual because I never can remember the exact syntax. Which is how I see this tool helping. Do we have any enthusiastic people to take this on? I bet you could have something usable in less than a days worth of hacking. Jason

Quoth Jason Dagit, nevermore,
Do we have any enthusiastic people to take this on? I bet you could have something usable in less than a days worth of hacking.
I'll give it a try. Of course I take this opportunity to solicit
suggestions for a name for this application. Which is to say, what
colour should my bike shed be? ;-)
D.
--
Dougal Stanton

Dougal Stanton wrote:
Quoth Jason Dagit, nevermore,
Do we have any enthusiastic people to take this on? I bet you could have something usable in less than a days worth of hacking.
I'll give it a try. Of course I take this opportunity to solicit suggestions for a name for this application. Which is to say, what colour should my bike shed be? ;-)
D.
JoinCabal

On 11/19/06, Dougal Stanton
Quoth Jason Dagit, nevermore,
Do we have any enthusiastic people to take this on? I bet you could have something usable in less than a days worth of hacking.
I'll give it a try. Of course I take this opportunity to solicit suggestions for a name for this application. Which is to say, what colour should my bike shed be? ;-)
Here is a list to draw ideas from: The Haskell Project Wizard (bit long but descriptive) Cabal Wizard darcs2cabal autoproj cabalize (the cabalizer?) The project butler repo nanny? bikeshedgen I'd say have fun with it :) And as Chris points out in a different email, team up with the cabal folks or at least plan to join them by the time you reach your first release. Jason

Hello Jason, Sunday, November 19, 2006, 3:55:05 PM, you wrote:
I'll give it a try. Of course I take this opportunity to solicit suggestions for a name for this application. Which is to say, what colour should my bike shed be? ;-)
I'd say have fun with it :)
me, me too! :) HelloHaskell HsInit AAAAA MenuFileNew CabalSecretary NewToHaskell? HaskellNewbie ProjectGenerator -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

dagit:
On 11/19/06, Dougal Stanton
wrote: Quoth Donald Bruce Stewart, nevermore,
P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.
I was wondering about that just the other day. Is there such an application to interrogate the user about particulars and then create a fully compliant *.cabal file?
I'm unaware of such a tool, but as far as UIs go, it should be fairly
Ok, done! darcs get http://www.cse.unsw.edu.au/~dons/code/mkcabal mkcabal creates a new project directory for an executable, populates with cabal files, setup.hs and a stub .hs file, based on the project name. A transcript: $ mkcabal Project name: haq Created new project directory: haq $ cd haq $ ls Haq.hs Setup.hs haq.cabal $ cat Haq.hs main :: IO () main = putStrLn "Hello, world!" $ cat Setup.hs #!/usr/bin/env runhaskell import Distribution.Simple $ cat haq.cabal Name: haq Version: 0.0 Description: Project description License: BSD3 License-file: LICENSE Author: Author Name Maintainer: user@email.address Build-Depends: base Executable: haq Main-is: Haq.hs $ c Configuring haq-0.0... ... $ b Preprocessing executables for haq-0.0... Building haq-0.0... [1 of 1] Compiling Main ( Haq.hs, /usr/obj/cabal/haq/haq-tmp/Main.o ) Linking /usr/obj/cabal/haq/haq ... And we're in business. We could be smarter and figure out more defaults, and generate some stub quickcheck and haddock details. We could also init and create the project in a darcs directory. Comments, suggestions *and patches* welcome! -- Don

dons:
dagit:
On 11/19/06, Dougal Stanton
wrote: Quoth Donald Bruce Stewart, nevermore,
P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.
I was wondering about that just the other day. Is there such an application to interrogate the user about particulars and then create a fully compliant *.cabal file?
I'm unaware of such a tool, but as far as UIs go, it should be fairly
Ok, done!
darcs get http://www.cse.unsw.edu.au/~dons/code/mkcabal
mkcabal creates a new project directory for an executable, populates with cabal files, setup.hs and a stub .hs file, based on the project name.
Jason suggested that it should create just: Setup.hs foo.cabal by default. This is now what mkcabal does. So you can use it to generate stub .cabal files for existing projects. $ runhaskell mkcabal.hs Project name: x Created Setup.hs and x.cabal For entirely new projects, mkcabal --init-project creates an entire new project tree. $ runhaskell mkcabal.hs --init-project Project name: ruby-on-rails-killer Created new project directory: ruby-on-rails-killer $ ls ruby-on-rails-killer LICENSE Ruby-on-rails-killer.hs ruby-on-rails-killer.cabal README Setup.hs Further wishlists would be for the default to scan for src files to populate the .cabal file with, and to distinguish libraries from executables. Feedback welcome -- Don

Hi, Am Montag, den 20.11.2006, 00:32 +1100 schrieb Donald Bruce Stewart:
For entirely new projects, mkcabal --init-project creates an entire new project tree.
$ runhaskell mkcabal.hs --init-project Project name: ruby-on-rails-killer Created new project directory: ruby-on-rails-killer
$ ls ruby-on-rails-killer LICENSE Ruby-on-rails-killer.hs ruby-on-rails-killer.cabal README Setup.hs
Where can I find ruby-on-rails-killer? Joachim (SCNR) -- Joachim Breitner e-Mail: mail@joachim-breitner.de Homepage: http://www.joachim-breitner.de ICQ#: 74513189

Hello Donald, Sunday, November 19, 2006, 4:32:10 PM, you wrote:
For entirely new projects, mkcabal --init-project creates an entire new project tree.
$ runhaskell mkcabal.hs --init-project
i think it should be asked instead of using option. and in general it will be better to split this program into the worker/driver parts. we will have many drivers which asks users (using stdio, curses, GUI) and then cmdline-driven worker will be invoked to do the real work. worker can also be used by other automation tools -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Hello Donald, Sunday, November 19, 2006, 4:32:10 PM, you wrote:
For entirely new projects, mkcabal --init-project creates an entire new project tree.
$ runhaskell mkcabal.hs --init-project
i think it should be asked instead of using option.
I like the way darcs handles this (mostly), i.e. ask the user if and only if there is no explicit command line option. Options (and thus no questions asked) are good e.g. for scripting. Ben

Hello Jason, Sunday, November 19, 2006, 3:08:53 PM, you wrote:
great way to get some fame in the community). I'm imagining the tool looks at your darcs repository, asks you a few questions and then generates a .cabal file.
and another one which looks at the cabal file and generates darcs repository. and both should lazily consume its input data to allow true beginners create both files in mutual recursive way :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Dougal, Sunday, November 19, 2006, 2:10:09 PM, you wrote:
P.S. It might even be useful to have a tool, haskell-project, which sets up all these files automatically.
I was wondering about that just the other day. Is there such an application to interrogate the user about particulars and then create a fully compliant *.cabal file?
Haskell killer app implementing point-and-shoot programming paradigm :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Sun, Nov 19, 2006 at 03:41:29PM +1100, Donald Bruce Stewart wrote:
http://haskell.org/haskellwiki/How_to_write_a_Haskell_program
Feedback welcome!
There is inconsistent advice regarding Setup.hs/Setup.lhs. (#! in .hs files seems to be a feature of GHC Haskell.) For releases, another possibility is Cabal's sdist feature. This will do a bit more checking, and ensure that the tarball has the structure expected by HackageDB. In the example project, you'd want to add extra-source-files: Tests.hs to make this work. Regarding hosting, I don't think that darcs.haskell.org is the preferred solution (unfortunately nor is anything else). Regarding publicity, another possibility is HackageDB, even if it's not fully working yet (http://hackage.haskell.org/trac/hackage).

ross:
On Sun, Nov 19, 2006 at 03:41:29PM +1100, Donald Bruce Stewart wrote:
http://haskell.org/haskellwiki/How_to_write_a_Haskell_program
Feedback welcome!
There is inconsistent advice regarding Setup.hs/Setup.lhs. (#! in .hs files seems to be a feature of GHC Haskell.)
Fixed. And mkcabal generates .lhs Setups now.
For releases, another possibility is Cabal's sdist feature. This will do a bit more checking, and ensure that the tarball has the structure expected by HackageDB. In the example project, you'd want to add
extra-source-files: Tests.hs
to make this work.
Thanks for the constructive suggestions Ross. I've added information on Cabal's sdist to the page. -- Don
participants (8)
-
Benjamin Franksen
-
Bulat Ziganshin
-
Chris Kuklewicz
-
dons@cse.unsw.edu.au
-
Dougal Stanton
-
Jason Dagit
-
Joachim Breitner
-
Ross Paterson