tldr/pages/common/stack.md

29 lines
549 B
Markdown
Raw Normal View History

2017-10-01 18:53:11 +01:00
# stack
2017-10-01 18:54:34 +01:00
> Tool for managing 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
2019-11-24 20:08:35 +00:00
`stack new {{package_name}} {{template_name}}`
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_name}} -- {{argument}}`