Skip to content

Commit b648467

Browse files
committed
Add doc for Loading script in ghci
Fixes commercialhaskell#2788
1 parent f17d1df commit b648467

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

doc/GUIDE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,22 @@ The `runghc` command is still very useful, especially when you're working on a
17711771
project and want to access the package databases and configurations used by
17721772
that project. See the next section for more information on configuration files.
17731773
1774+
### Loading script in ghci
1775+
1776+
There would be instances when you want to load your script in ghci
1777+
REPL to play around with your program. In those cases, you can use
1778+
`exec ghci` option in the script to achieve it. Here is an example:
1779+
1780+
```
1781+
#!/usr/bin/env stack
1782+
{- stack
1783+
--resolver lts-8.2
1784+
--install-ghc
1785+
exec ghci
1786+
--package text
1787+
-}
1788+
```
1789+
17741790
## Finding project configs, and the implicit global
17751791
17761792
Whenever you run something with stack, it needs a `stack.yaml` project file. The

0 commit comments

Comments
 (0)