File: eval_command.md

package info (click to toggle)
haskell-stack 2.15.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,568 kB
  • sloc: haskell: 37,057; makefile: 6; ansic: 5
file content (20 lines) | stat: -rw-r--r-- 720 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div>

# The `stack eval` command

~~~text
stack eval CODE [--[no-]ghc-package-path] [--[no-]stack-exe]
           [--package PACKAGE] [--rts-options RTSFLAG] [--cwd DIR]
~~~

GHC has an
[expression-evaluation mode](https://downloads.haskell.org/ghc/latest/docs/users_guide/using.html#eval-mode),
set by passing the GHC option
`-e <expression>`. Commanding `stack eval <code>` is equivalent to commanding:

~~~text
stack exec ghc -- -e <code>
~~~

For further information, see the [`stack exec` command](exec_command.md)
documentation.