-
Notifications
You must be signed in to change notification settings - Fork 697
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
Something like --save in npm? #1961
Comments
We already have |
I don't think that's the same thing as I'm suggesting. Could you provide a quick example? |
Oh, I see. |
Is the feature you're really missing the addition of the package to the .cabal file or is it freezing the version of the package. Latest often doesn't make sense. There's no guarantee that there's a working install plan that involve the latest version of the dependency. There's a soft preference in |
Just the addition of the package to the cabal file, given that |
If you only want to mention the package ones you can instead do this:
This has the same result. Automatically rewriting the .cabal file is difficult, as we want to preserve spacing and user comments. Some day we'll be able to do it. |
I guess that's one way to do it, but it probably doesn't save any time. Oh well, unto the future. |
👍 for a |
👍 from me too - I really enjoy this feature for fast prototyping in node; something i really enjoy doing in haskell too. A little thing, but it makes a developer-happiness difference for me :) |
👍 -- exactly what hughfdjackson said |
👍 for a It's very inconvenient edit .cabal for adding package! |
I just sat down to see if I could implement this and found a difference between what In So what makes the most semantic sense for a
|
@folsen, Thank you for research! 👍 3. I'm beginner in Haskell, and i think that If save to all use case is common, that team would be add something like this Excuse my beginner's English |
Just a thought cabal file executable server
-- stuff
build-depends: base >=4.8 && <4.9 install command cabal install foo --save server build or
result executable server
-- stuff
build-depends: base >=4.8 && <4.9
, foo 1.3.6 |
This is a shell script 'solution' I've put together so we can have this functionality even before it is implemented in cabal: https://github.com/Wizek/cabal-install-save It looks for the latest version of the specified package, adds it to the *.cabal file then does a Installation: $ git clone [email protected]:Wizek/cabal-install-save.git
$ # Export to path:
$ echo 'export $PATH:'`pwd`'/cabal-install-save/bin' >> ~/.*hrc Usage: $ cd /to/a/cabal/project
$ cabal-install-save foobar Questions, comments, issues and pull requests are welcome. |
Correct me if I'm wrong, but I think this issue has been addressed by stack. No? Shouldn't we just use stack from now on instead of using cabal directly? At the very least for conveniences like those being discussed here? |
How does |
AFAIK |
One of the fundamental problems here is that there's not a "proper" parser for |
👍 |
closing as dup in favor of linked ticket |
npm (the Node.js package manager) allows you to install packages and automatically add the latest version to the dependency list of your package.
It would be cool if you could add a --save flag, which given any scope (including sandboxes) would look for a .cabal file in the current directory and
Example usage:
At least for my node project, it made dependency version management super breezy.
The text was updated successfully, but these errors were encountered: