tldr/pages/common/stack.md

29 lines
523 B
Markdown
Raw Normal View History

2017-10-01 18:53:11 +01:00
# stack
> Manage Haskell projects.
> More information: <https://github.com/commercialhaskell/stack>.
2017-10-01 18:53:11 +01:00
2019-11-24 20:08:35 +00:00
- Create a new package:
2017-10-01 18:53:11 +01:00
`stack new {{package}} {{template}}`
2017-10-01 18:53:11 +01:00
2019-11-24 20:08:35 +00:00
- Compile a package:
2017-10-01 18:53:11 +01:00
`stack build`
2019-11-24 20:08:35 +00:00
- Run tests inside a package:
2017-10-01 18:53:11 +01:00
`stack test`
- Compile a project and re-compile every time a file changes:
`stack build --file-watch`
- Compile a project and execute a command after compilation:
`stack build --exec "{{command}}"`
2017-12-19 12:01:07 +00:00
- Run a program and pass an argument to it:
`stack exec {{program}} -- {{argument}}`