Here's a recommended directory structure for managing multiple executables in a Stack project:
.
├── App1
│ ├── Main.hs
│ └── stack.yaml
├── App2
│ ├── Main.hs
│ └── stack.yaml
├── App3
│ ├── Main.hs
│ └── stack.yaml
└── stack.yaml
Each App# directory contains the Haskell source code and Stack configuration for a specific executable. This allows you to build and run each executable independently using the following commands:
stack build App1
stack build App2
stack build App3
You can also run each executable directly from the corresponding directory:
cd App1
stack exec Main
This approach promotes modularity and makes it easier to reuse code between different executables. You can also define shared libraries and dependencies using Stack's configuration files.
Here's a recommended directory structure for managing multiple executables in a Stack project:
.
├── App1
│ ├── Main.hs
│ └── stack.yaml
├── App2
│ ├── Main.hs
│ └── stack.yaml
├── App3
│ ├── Main.hs
│ └── stack.yaml
└── stack.yaml
Each App# directory contains the Haskell source code and Stack configuration for a specific executable. This allows you to build and run each executable independently using the following commands:
stack build App1
stack build App2
stack build App3
You can also run each executable directly from the corresponding directory:
cd App1
stack exec Main
This approach promotes modularity and makes it easier to reuse code between different executables. You can also define shared libraries and dependencies using Stack's configuration files.