hpack icon indicating copy to clipboard operation
hpack copied to clipboard

Feature request: Add `hpack init` command

Open psibi opened this issue 8 years ago • 6 comments

Something like hpack init which will be an equivalent of cabal init would be nice to have.

psibi avatar Jul 12 '17 12:07 psibi

@sol Simon, if you aren't opposed to the feature, I will try to implement it myself. Let me know.

psibi avatar Jul 14 '17 08:07 psibi

My issue here is that at that point I would also set the convention on how a Haskell package should be structured.

I'm very opinionated about this:

  • source files into src
  • test files into test
  • Using hspec for tests, with test driver in test/Spec.hs (using hspec-discover)
  • etc.

(basically exactly like https://github.com/hspec/hspec-example)

BUT: Even though I think these conventions make sense, I still want hpack to be useful for people who don't agree with these conventions. This is why I'm tempted to not add hpack init (even though I would love to use it myself).

Project initialization may better be served by a standalone project, unix-style (to prevent tying, or more fittingly illegal bundling as @soenkehahn once called it).

sol avatar Jul 19 '17 05:07 sol

stack new can do this. It draws from stack-templates. Or you could use hi if you don't like Stack.

tfausak avatar Jul 21 '17 19:07 tfausak

+1 for this (even if it's just a parametrized template for use with some other tool like hi or stack). Right now I don't really know what options I need to have in my YML to get started with a minimal project.

masaeedu avatar May 21 '19 03:05 masaeedu

There are two things a hpack init could do:

  1. Scaffold a project (like stack new and hi)
  2. Generate a package.yaml from an existing .cabal file

While this thread seems to be about (1), I would be very interested in (2).

AriFordsham avatar Nov 02 '21 20:11 AriFordsham

That's what hpack-convert did, but it hasn't been updated in a while.

tfausak avatar Nov 02 '21 20:11 tfausak