stack is a build tool and project-management toolchain for Haskell projects. Running `stack new caesar` creates a ready-to-use project directory with configuration, application, library, and test areas. section 2.1.2
A new stack project separates responsibilities:
- `app` contains executable entry points such as `Main.hs`. section 2.1.2
- `src` contains reusable library modules, types, and functions; `Lib.hs` is the initial working file. section 2.1.2
- `test` holds test suites, while `stack.yaml`, `package.yaml`, and the Cabal file configure dependencies and compilation. section 2.1.2
Listing 2.1 The project structure for a new stack project
caesar
├── CHANGELOG.md
├── LICENSE
├── README.md
├── Setup.hs
├── app #1
│ └── Main.hs
├── caesar.cabal
├── package.yaml
├── src #2
│ └── Lib.hs
├── stack.yaml
└── test #3
└── Spec.hs
Inspect the generated project tree, including application, library, test, and configuration files. section 2.1.2
Use `stack repl` to enter GHCi from a stack project; its modules and definitions load automatically. Use `stack run` to build and execute the project. Place a single `--` before arguments intended for the executable, as in `stack run -- Testpath`. section 2.1.2 section 3.4.2
stack run <arguments for stack> -- <arguments for the program>
Use the command pattern to distinguish stack options from arguments passed to the program. section 3.4.2
