Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added servant-0.4 template #52

Merged
merged 1 commit into from
May 5, 2016
Merged

Conversation

soenkehahn
Copy link
Contributor

This PR adds a slightly bigger template for servant-0.4.

I put it in a subdirectory, because I thought it would make sense to start to organize the templates a bit, but I don't know if this'll actually work with stack new. I can move it to the root dir, of course.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 1, 2016

I don't think this works, because of things like stack templates, which lists the templates by enumerating the dir on github. The easiest way to lift that restriction would probably be to implement commercialhaskell/stack#1595

It would make sense to organize templates a little more. With autocompletion, this could work rather well. So you type "web/" + TAB and find out all the web templates.

@prikhi
Copy link

prikhi commented Apr 2, 2016

Related: I've created a servant-postgresql template for servant 0.5 & was wondering about a couple things:

  • Would this be accepted? Are there some sort of minimum requirements for new templates or will you accept anything useful & working? Is there a limit to how indepth a template can be(maybe that's more an on individual basis)?
  • Is there a way to compose templates? So this template & my template could reuse the Test file instead of having to duplicate the code?
  • Is there some sort of style guide for the final app? For instance, when specifying the executable, should Main.hs live in app/ or bin/ or exe/ or something else?
  • Is there a way to get stack to add servant-0.5 & servant-server-0.5 to the extra-deps in stack.yml when generating the app? Or should I rely on the cabal file & expect people to add --solver to their stack new command?

I will make a separate PR when I have some extra time.

@soenkehahn soenkehahn force-pushed the servant branch 2 times, most recently from a842107 to b41ff38 Compare April 4, 2016 08:07
@soenkehahn
Copy link
Contributor Author

@mgsloan: I've put the file in the root directory. I've also renamed it to indicate that it uses hspec-wai-json.

@prikhi: See a related discussion here: https://groups.google.com/d/topic/haskell-stack/sOI5rY28G3E/discussion

@mgsloan
Copy link
Contributor

mgsloan commented Apr 4, 2016

@prikhi Not really the best place to discuss, I have opened a few issues:

#55
commercialhaskell/stack#1994
#56

@mgsloan
Copy link
Contributor

mgsloan commented Apr 4, 2016

I'd really prefer a short name. Imagine someone typing this in! We do not have shell autocompletion of template names yet. servant or servant-0.4 is fine.

I'm actually on the wall as to whether it's useful to have templates for specific libraries like this, as described in #55 . I really don't want to start seeing lens-aeson-hspec-containers templates.

In the meantime I'm happy to merge very library specific templates, but the policy may change. I don't really want the default library creation process to include "make a stack template"

@soenkehahn
Copy link
Contributor Author

@mgsloan: That makes a lot of sense. I've renamed it to servant-0.4. (There's already a servant template.)

@mgsloan
Copy link
Contributor

mgsloan commented May 5, 2016

Oops forgot to merge. Thanks!

@mgsloan mgsloan merged commit f010e2e into commercialhaskell:master May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants