tldr/pages/common/stack.md

33 lines
585 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.
2019-05-15 09:01:58 +01:00
> Homepage: <https://github.com/commercialhaskell/stack>.
2017-10-01 18:53:11 +01:00
- Create a new project:
`stack new {{project_name}}`
- Install all packages needed by a project:
`stack install`
- Compile a project:
`stack build`
- Run tests inside a project:
`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}}`