Skip to content

Commit c12a3ce

Browse files
committed
Document the implicit global in the FAQ
Pinging @ndmitchell. This is a kind of out-of-the-way place to be explaining this, but I couldn't think of a better one. If you have a recommendation for where better to include the stack config command, let me know.
1 parent bff17a8 commit c12a3ce

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/faq.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ So that this doesn't become repetitive: for the reasons behind the answers
44
below, see the [Architecture](architecture.md) page. The goal of the answers
55
here is to be as helpful and concise as possible.
66

7+
## What version of GHC is used when I run something like `stack ghci`?
8+
9+
The version of GHC, as well as which packages can be installed, are
10+
specified by the _resolver_. This may be something like `lts-8.12`,
11+
which is from the
12+
[Long Term Support (LTS) Haskell](https://github.com/fpco/lts-haskell/)
13+
project. The [user guide](GUIDE.md) discusses resolvers in more
14+
detail.
15+
16+
Which resolver is used is determined by finding the relevant
17+
`stack.yaml` configuration file for the directory you're running the
18+
command from. This essentially works by:
19+
20+
1. Check for a `STACK_YAML` environment variable or the `--stack-yaml`
21+
command line argument
22+
2. If none present, check for a `stack.yaml` file in the current
23+
directory or any parents
24+
3. If no `stack.yaml` was found, use the _implicit global_
25+
26+
The implicit global is a shared project used whenever you're outside
27+
of another project. It's a sort of "mutable shared state" that you
28+
should be aware of when working with Stack. The most recent request
29+
when working with the implicit global is how to move to a more recent
30+
LTS snapshot. You can do this by running the following from outside of
31+
a project:
32+
33+
stack config set resolver lts
34+
735
## Where is stack installed and will it interfere with `ghc` (etc) I already have installed?
836

937
Stack itself is installed in normal system locations based on the mechanism you

0 commit comments

Comments
 (0)