@@ -205,39 +205,37 @@ Stack can be installed directly or by using the GHCup tool.
205205
206206## Quick Start guide
207207
208- For an immediate experience of using Stack to build an executable with Haskell,
209- first you need to follow the [ guide to install Stack ] ( #how-to-install-Stack ) .
208+ Once Stack is installed, you can get an immediate experience of using it to
209+ build an executable with Haskell .
210210
211211### Step 1: Start your new project
212212
213213A complex project can have more than one package and each package can have more
214214than one executable (program). However, to start a new single-package project
215- named ` my-project ` , issue these four commands in a terminal:
216-
217- 1 . ` stack new my-project `
218-
219- This command will create a new directory, named ` my-project ` . It contains
220- all the files needed to start a project correctly, using a default template.
221-
222- 2 . ` cd my-project `
215+ named ` my-project ` , issue these four commands in a terminal (click
216+ :material-plus-circle: to learn more about each command):
217+
218+ ~~~ shell
219+ stack new my-project # (1)!
220+ cd my-project # (2)!
221+ stack build # (3)!
222+ stack exec my-project-exe # (4)!
223+ ~~~
223224
224- This command will change the current working directory to that directory.
225+ 1 . Create a new directory named ` my-project ` . It contains all the files needed
226+ to start a project correctly, using a default template.
225227
226- 3 . ` stack build `
228+ 2 . Change the current working directory to ` my-project ` .
227229
228- This command will build the template project and create an executable named
229- ` my-project-exe ` (on Windows, ` my-project-exe.exe ` ).
230+ 3 . Build the template project and create an executable named ` my-project-exe ` .
230231
231232 First, if necessary, Stack will download a version of GHC in an isolated
232233 location. That won't interfere with other GHC installations on your system.
233234 (On Windows, if necessary, Stack will also download
234235 [ MSYS2] ( https://www.msys2.org/ ) . MSYS2 is a project that provides popular
235- tools for developers on Windows).
236+ tools for developers on Windows.)
236237
237- 4 . ` stack exec my-project-exe `
238-
239- This command will run (execute) the built executable, in Stack's
240- environment.
238+ 4 . Run (execute) the built executable, in Stack's environment.
241239
242240For a complete list of Stack's commands, and flags and options common to those
243241commands, simply command:
@@ -255,13 +253,11 @@ stack build --help
255253
256254If you want to launch a run-eval-print loop (REPL) environment, then command:
257255
258- ~~~ text
259- stack repl
256+ ~~~ shell
257+ stack repl # (1)!
260258~~~
261259
262- !!! info
263-
264- `stack ghci` can be used instead of `stack repl`. GHCi is GHC's REPL tool.
260+ 1 . ` stack ghci ` can be used instead of ` stack repl ` . GHCi is GHC's REPL tool.
265261
266262People organise Haskell code into packages. If you want to use Stack to install
267263an executable provided by a Haskell package, then all you have to do is command:
@@ -273,60 +269,72 @@ stack install <package-name>
273269### Step 2: Next steps
274270
275271The ` stack new my-project ` command in step one should have created the following
276- files and directories (among others):
272+ files and directories, among others. Click :material-plus-circle: to learn more
273+ about each file:
277274
278- ~~~ text
275+ ~~~ shell
279276.
280277├── app
281- │ └── Main.hs
278+ │ └── Main.hs # (1)!
282279├── src
283- │ └── Lib.hs
280+ │ └── Lib.hs # (2)!
284281├── test
285- │ └── Spec.hs
286- ├── my-project.cabal
287- ├── package.yaml
288- └── stack.yaml
282+ │ └── Spec.hs # (3)!
283+ ├── my-project.cabal # (4)!
284+ ├── package.yaml # (5)!
285+ └── stack.yaml # (6)!
289286~~~
290287
291- The Haskell source code for the executable (application) is in file ` Main.hs ` .
288+ 1 . The Haskell source code for the executable (application).
289+
290+ As your project develops you can add further source code files to the ` app `
291+ directory.
292+
293+ 2 . The executable uses a library. The Haskell source code for the library.
292294
293- The executable uses a library. Its source code is in file ` Lib.hs ` .
295+ As your project develops you can add further source code files to the ` src `
296+ directory.
294297
295- The contents of ` my-project.cabal ` describes the project's package. That file is
296- generated by the contents of ` package.yaml ` .
298+ 3 . The package has a test suite executable. The Haskell source code for the
299+ test suite .
297300
298- !!! info
301+ As your project develops you can add further source code files to the ` test `
302+ directory.
299303
300- If you want, you can delete the `package.yaml` file and update the
301- `my-project.cabal` file directly. Stack will then use that file.
304+ 4 . A file describing the package in the Cabal format, including other packages
305+ on which depends. Stack generates it from the contents of the ` package.yaml `
306+ file.
302307
303- The contents of ` stack .yaml` describe Stack's own project-level configuration .
308+ If the ` package .yaml` file is deleted, Stack will use the Cabal file .
304309
305- You can edit the source files in the ` src ` directory (used for the library) or
306- the ` app ` directory (used for the executable (application)) .
310+ 5 . A file describing the package in the Hpack format. Stack generates the
311+ ` my-project.cabal ` file from its contents .
307312
308- As your project develops, you may need to depend on a library provided by
309- another Haskell package. If you do, then add the name of that new package to the
310- file ` package.yaml ` , in its ` dependencies: ` section.
313+ If you want, you can delete the file and update the Cabal file directly.
311314
312- !!! info
315+ As your project develops, you may need to depend on a library provided by
316+ another Haskell package. If you do, add the name of that new package to
317+ the ` dependencies: ` section.
313318
314- When you use `stack build` again, Stack will use `package.yaml` to create an
315- updated `my-project.cabal` for you.
319+ 6 . Stack's project-level configuration. This specifies a snapshot that, in
320+ turn, specifies a version of GHC and a set of package versions chosen to
321+ work well together. It also identifies the local packages in the project.
316322
317- If Stack reports that the Stack configuration has no specified version for the
318- new package, then follow Stack's likely recommended action to add a specific
319- version of that package your project 's ` stack.yaml ` file, in its ` extra-deps: `
320- section.
323+ If you add a new package as a dependency in the package description, and
324+ Stack reports that the Stack configuration has no specified version for it,
325+ then follow Stack 's likely recommended action to add a specific version to
326+ the ` extra-deps: ` section.
321327
322328That was a really fast introduction on how to start to code in Haskell using
323- Stack. If you want to go further, we highly recommend you read Stack's
324- introductory [ user's guide ] ( tutorial/index.md ) .
329+ Stack. If you want to go further, we recommend you read Stack's guide to
330+ [ getting started ] ( tutorial/index.md ) .
325331
326332## Complete guide to Stack
327333
328- A complete [ user's guide] ( tutorial/index.md ) to Stack is available, covering all
329- of the most common ways to use Stack. Terms used in Stack's documentation are
334+ A complete guide to Stack is available, covering the most common ways to
335+ [ use Stack] ( tutorial/index.md ) , its [ commands] ( commands/index.md ) , its
336+ [ configuration] ( configure/index.md ) , specific [ topics] ( topics/index.md ) , and
337+ [ frequently asked questions] ( faq.md ) . Terms used in Stack's documentation are
330338also explained in the [ glossary] ( glossary.md ) .
331339
332340## Why Stack?
@@ -338,38 +346,58 @@ experienced developers need.
338346
339347Stack does not stand alone. It is built on the great work provided by:
340348
341- * The __ Glasgow Haskell Compiler__ ([ GHC] ( https://www.haskell.org/ghc/ ) ), the
342- premier Haskell compiler. Stack will manage your GHC installations and
343- automatically select the appropriate version of GHC for your project.
344- * The __ Cabal build system__ . Cabal is a specification for defining Haskell
345- packages and a [ library] ( https://hackage.haskell.org/package/Cabal ) for
346- performing builds.
349+ <div class =" grid cards " markdown >
350+
351+ - :fontawesome-solid-gears:{ .lg .middle } __ Glasgow Haskell Compiler__
352+
353+ The premier Haskell compiler. Stack will manage your GHC
354+ installations and automatically select the appropriate version of GHC for
355+ your project.
356+
357+ ---
347358
348- !!! info
359+ [ :octicons-arrow-right-24: Learn more ] ( https://www.haskell.org/ghc/ )
349360
350- Cabal is also the name of another tool used for building Haskell code,
361+ - :fontawesome-solid-trowel-bricks:{ .lg .middle } __ Cabal build system__
362+
363+ A specification for defining Haskell packages and a library for performing
364+ builds.[ ^ 1 ]
365+
366+ [ ^ 1 ] :
367+ Cabal is also the name of a tool used for building Haskell code,
351368 provided by the ` cabal-install ` package. This guide distinguishes
352369 between them by Cabal (the library) and Cabal (the tool).
353370
354- * The __ Hackage Haskell Package Repository__ , a
355- [ repository] ( https://hackage.haskell.org/ ) of Haskell packages providing
356- thousands of open source libraries and applications to help you get your work
357- done.
358- * The __ Stackage package collection__ , sets of packages from Hackage that are
359- [ curated] ( https://www.stackage.org/ ) . That is, they are regularly tested for
360- compatibility. Stack defaults to using Stackage package sets to avoid
361- problems with incompatible dependencies.
371+ ---
372+
373+ [ :octicons-arrow-right-24: Learn more] ( https://hackage.haskell.org/package/Cabal )
374+
375+ - :octicons-database-24:{ .lg .middle } __ Hackage__
376+
377+ A repository of Haskell packages providing thousands of open source
378+ libraries and applications to help you get your work done.
379+
380+ ---
381+
382+ [ :octicons-arrow-right-24: Learn more] ( https://hackage.haskell.org/ )
383+
384+ - :fontawesome-solid-cubes-stacked:{ .lg .middle } __ Stackage__
385+
386+ Sets of packages from Hackage that are chosen to work well together and
387+ with a specific version of GHC.
388+
389+ ---
390+
391+ [ :octicons-arrow-right-24: Learn more] ( https://www.stackage.org/ )
392+
393+ </div >
362394
363395Stack is provided by a team of volunteers and companies under the auspices of
364396the [ Commercial Haskell] ( http://commercialhaskell.com/ ) group. The project was
365397originally spearheaded by [ FP Complete] ( https://www.fpcomplete.com/ ) to answer
366398the needs of commercial Haskell users. It has since become a thriving open
367399source project meeting the needs of Haskell users of all types.
368400
369- If you'd like to get involved with Stack, check out the
370- [ newcomer friendly] ( https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3a%22newcomer+friendly%22 )
371- label on the GitHub issue tracker.
372-
373401## Questions?
374402
375403For answers to frequently asked questions about Stack, please see the
0 commit comments