|
4 | 4 | [](https://ci.appveyor.com/project/snoyberg/stack)
|
5 | 5 | [](https://github.com/commercialhaskell/stack/releases)
|
6 | 6 |
|
7 |
| -`stack` is a cross-platform program for developing Haskell |
8 |
| -projects. It is aimed at Haskellers both new and experienced. |
| 7 | +`stack` is a cross-platform program for developing Haskell projects. It is aimed |
| 8 | +at Haskellers both new and experienced. |
9 | 9 |
|
10 |
| -<img src="http://i.imgur.com/WW69oTj.gif" width="50%" align="right"> |
11 |
| - |
12 |
| -It features: |
13 |
| - |
14 |
| -* Installing GHC automatically, in an isolated location. |
15 |
| -* Installing packages needed for your project. |
16 |
| -* Building your project. |
17 |
| -* Testing your project. |
18 |
| -* Benchmarking your project. |
19 |
| - |
20 |
| -#### How to install |
21 |
| - |
22 |
| -Downloads are available by operating system: |
23 |
| - |
24 |
| -* [Windows](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#windows) |
25 |
| -* [Mac OS X](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#mac-os-x) |
26 |
| -* [Ubuntu](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#ubuntu) |
27 |
| -* [Debian](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#debian) |
28 |
| -* [CentOS / Red Hat / Amazon Linux](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#centos--red-hat--amazon-linux) |
29 |
| -* [Fedora](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#fedora) |
30 |
| -* [Arch Linux](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#arch-linux) |
31 |
| -* [NixOS](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#nixos) |
32 |
| -* [Linux (general)](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#linux) |
33 |
| - |
34 |
| -[Upgrade instructions](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md#upgrade) |
35 |
| - |
36 |
| -Note: if you are using cabal-install to install stack, you may need to pass a |
37 |
| -constraint to work around a |
38 |
| -[Cabal issue](https://github.com/haskell/cabal/issues/2759): `cabal install |
39 |
| ---constraint 'mono-traversable >= 0.9' stack`. |
40 |
| - |
41 |
| -#### Quick Start Guide |
42 |
| - |
43 |
| -First you need to [install it (see previous section)](#how-to-install). |
44 |
| - |
45 |
| -##### Start your new project: |
46 |
| - |
47 |
| -~~~ {.bash} |
48 |
| -stack new my-project |
49 |
| -cd my-project |
50 |
| -stack setup |
51 |
| -stack build |
52 |
| -stack exec my-project-exe |
53 |
| -~~~ |
54 |
| - |
55 |
| -- The `stack new` command will create a new directory containing all |
56 |
| -the needed files to start a project correctly. |
57 |
| -- The `stack setup` will download the compiler if necessary in an isolated |
58 |
| - location (default `~/.stack`) that won't interfere with any system-level |
59 |
| - installations. (For information on installation paths, please use the `stack |
60 |
| - path` command.). |
61 |
| -- The `stack build` command will build the minimal project. |
62 |
| -- `stack exec my-project-exe` will execute the command. |
63 |
| -- If you just want to install an executable using stack, then all you have to do |
64 |
| -is`stack install <package-name>`. |
65 |
| - |
66 |
| -If you want to launch a REPL: |
67 |
| - |
68 |
| -~~~ {.bash} |
69 |
| -stack ghci |
70 |
| -~~~ |
71 |
| - |
72 |
| - |
73 |
| -Run `stack` for a complete list of commands. |
74 |
| - |
75 |
| -##### Workflow |
76 |
| - |
77 |
| -The `stack new` command should have created the following files: |
78 |
| - |
79 |
| -~~~ |
80 |
| -. |
81 |
| -├── LICENSE |
82 |
| -├── Setup.hs |
83 |
| -├── app |
84 |
| -│ └── Main.hs |
85 |
| -├── my-project.cabal |
86 |
| -├── src |
87 |
| -│ └── Lib.hs |
88 |
| -├── stack.yaml |
89 |
| -└── test |
90 |
| - └── Spec.hs |
91 |
| -
|
92 |
| - 3 directories, 7 files |
93 |
| -~~~ |
94 |
| - |
95 |
| -So to manage your library: |
96 |
| - |
97 |
| -1. Edit files in the `src/` directory. |
98 |
| - |
99 |
| -The `app` directory should preferably contains only files related to |
100 |
| -executables. |
101 |
| - |
102 |
| -2. If you need to include another library (for example the package [`text`](https://hackage.haskell.org/package/text): |
103 |
| - |
104 |
| - - Add the package `text` to the file `my-project.cabal` |
105 |
| - in the section `build-depends: ...`. |
106 |
| - - run `stack build` another time |
107 |
| - |
108 |
| -3. If you get an error that tells you your package isn't in the LTS. |
109 |
| - Just try to add a new version in the `stack.yaml` file in the `extra-deps` section. |
110 |
| - |
111 |
| -It was a really fast introduction on how to start to code in Haskell using `stack`. |
112 |
| -If you want to go further, we highly recommend you to read the [`stack` guide](https://github.com/commercialhaskell/stack/blob/release/doc/GUIDE.md). |
113 |
| - |
114 |
| -#### How to contribute |
115 |
| - |
116 |
| -This assumes that you have already installed a version of stack, and have `git` |
117 |
| -installed. |
118 |
| - |
119 |
| -1. Clone `stack` from git with |
120 |
| - `git clone https://github.com/commercialhaskell/stack.git`. |
121 |
| -2. Enter into the stack folder with `cd stack`. |
122 |
| -3. Build `stack` using a pre-existing `stack` install with |
123 |
| - `stack setup && stack build`. |
124 |
| -4. Once `stack` finishes building, check the stack version with |
125 |
| - `stack --version`. Make sure the version is the latest. |
126 |
| -5. Look for issues tagged with |
127 |
| - [`newcomer` and `awaiting-pr` labels](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3Anewcomer+label%3A%22awaiting+pr%22) |
128 |
| - |
129 |
| -Build from source as a one-liner: |
130 |
| - |
131 |
| -```bash |
132 |
| -git clone https://github.com/commercialhaskell/stack.git && \ |
133 |
| -cd stack && \ |
134 |
| -stack setup && \ |
135 |
| -stack build |
136 |
| -``` |
137 |
| - |
138 |
| -#### Complete guide to stack |
139 |
| - |
140 |
| -This repository also contains a complete [user guide to using stack |
141 |
| -](https://github.com/commercialhaskell/stack/blob/release/doc/GUIDE.md), covering all of the most common use cases. |
142 |
| - |
143 |
| - |
144 |
| -#### Questions, Feedback, Discussion |
145 |
| - |
146 |
| -* For frequently asked questions about detailed or specific use-cases, please |
147 |
| - see [the FAQ](https://github.com/commercialhaskell/stack/blob/release/doc/faq.md). |
148 |
| -* For general questions, comments, feedback and support please write |
149 |
| - to [the stack mailing list](https://groups.google.com/d/forum/haskell-stack). |
150 |
| -* For bugs, issues, or requests please |
151 |
| - [open an issue](https://github.com/commercialhaskell/stack/issues/new). |
152 |
| -* When using Stack Overflow, please use [the haskell-stack |
153 |
| - tag](http://stackoverflow.com/questions/tagged/haskell-stack). |
154 |
| - |
155 |
| -#### Why stack? |
156 |
| - |
157 |
| -stack is a project of the [Commercial Haskell](http://commercialhaskell.com/) |
158 |
| -group, spearheaded by [FP Complete](https://www.fpcomplete.com/). It is |
159 |
| -designed to answer the needs of commercial Haskell users, hobbyist Haskellers, |
160 |
| -and individuals and companies thinking about starting to use Haskell. It is |
161 |
| -intended to be easy to use for newcomers, while providing the customizability |
162 |
| -and power experienced developers need. |
163 |
| - |
164 |
| -While stack itself has been around since June of 2015, it is based on codebases |
165 |
| -used by FP Complete for its corporate customers and internally for years prior. |
166 |
| -stack is a refresh of that codebase combined with other open source efforts |
167 |
| -like [stackage-cli](https://github.com/fpco/stackage-cli) to meet the needs of |
168 |
| -users everywhere. |
169 |
| - |
170 |
| -A large impetus for the work on stack was a [large survey of people interested |
171 |
| -in |
172 |
| -Haskell](https://www.fpcomplete.com/blog/2015/05/thousand-user-haskell-survey), |
173 |
| -which rated build issues as a major concern. The stack team hopes that stack |
174 |
| -can address these concerns. |
175 |
| - |
176 |
| -<hr> |
177 |
| - |
178 |
| -## Documentation Table Of Contents |
179 |
| - |
180 |
| -* Project Documentation |
181 |
| - * [Maintainer Guide](https://github.com/commercialhaskell/stack/blob/release/doc/MAINTAINER_GUIDE.md): includes releasing information |
182 |
| - * [Signing Key](https://github.com/commercialhaskell/stack/blob/release/doc/SIGNING_KEY.md): downloadable stack binaries are signed |
183 |
| - with this key |
184 |
| -* Tool Documentation |
185 |
| - * [Build Command](https://github.com/commercialhaskell/stack/blob/release/doc/build_command.md): reference for the syntax of the |
186 |
| - build command and the command line targets |
187 |
| - * [Dependency Visualization](https://github.com/commercialhaskell/stack/blob/release/doc/dependency_visualization.md): uses Graphviz |
188 |
| - * [Docker Integration](https://github.com/commercialhaskell/stack/blob/release/doc/docker_integration.md) |
189 |
| - * [FAQ](https://github.com/commercialhaskell/stack/blob/release/doc/faq.md): frequently asked questions about detailed or specific |
190 |
| - use-cases |
191 |
| - * [Install/Upgrade](https://github.com/commercialhaskell/stack/blob/release/doc/install_and_upgrade.md): a list of downloads |
192 |
| - available by operating system, installation instructions, and upgrade |
193 |
| - instructions |
194 |
| - * [Nonstandard Project Initialization](https://github.com/commercialhaskell/stack/blob/release/doc/nonstandard_project_init.md) |
195 |
| - * [Shell Autocompletion](https://github.com/commercialhaskell/stack/blob/release/doc/shell_autocompletion.md) |
196 |
| - * [User Guide](https://github.com/commercialhaskell/stack/blob/release/doc/GUIDE.md): in-depth tutorial covering the most common use |
197 |
| - cases and all major stack features (requires no prior Haskell tooling |
198 |
| - experience) |
199 |
| - * [YAML Configuration](https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md): reference for writing |
200 |
| - `stack.yaml` files |
201 |
| -* Advanced Documentation |
202 |
| - * [Architecture](https://github.com/commercialhaskell/stack/blob/release/doc/architecture.md): reference for people curious about |
203 |
| - stack internals, wanting to get involved deeply in the codebase, or |
204 |
| - wanting to use stack in unusual ways |
| 10 | +See [haskellstack.org](http://haskellstack.org) or the `doc` directory for more |
| 11 | +information. |
0 commit comments