Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.13 KB

using_ghc_interactively.md

File metadata and controls

31 lines (22 loc) · 1.13 KB

13. Using GHC interactively

GHCi is the interactive GHC environment, a.k.a. the REPL. You could access it with command:

stack exec ghci

But that won't load up locally written modules for access. For that, use the stack ghci or stack repl commands, which are equivalent.

The stack ghci or stack repl command

To then load modules from your project in GHCi, use the :module command (:m for short) followed by the module name.

!!! note

If you have added packages to your project please make sure to mark them as
extra-deps for faster and reliable usage of `stack ghci`. Otherwise GHCi may
have trouble due to conflicts of compilation flags or having to
unnecessarily interpret too many modules. See Stack's project-level
[configuration](../configure/yaml/project.md#extra-deps) to learn how to
configure a package as an extra-dep.

For further information, see the REPL environment documentation.