Forrest logo
back to the ghci tool

ghci:tldr:ad9d7

ghci: Start a REPL with a colon-separated list of directories for finding source files.
$ ghci -i${path-to-directory1}:${path-to-directory2}
try on your machine

The command ghci -i${path-to-directory1}:${path-to-directory2} is used to start the GHCi (Glasgow Haskell Compiler interactive) interpreter with additional directories specified for module searching.

Here's a breakdown of the command:

  • ghci: It stands for Glasgow Haskell Compiler Interactive. This is the command used to start the GHCi interpreter.

  • -i: It is a command-line option used to specify additional directories to search for module files.

  • ${path-to-directory1}:${path-to-directory2}: These are the paths to the directories you want GHCi to search for modules. You need to replace ${path-to-directory1} with the actual path to the first directory and ${path-to-directory2} with the actual path to the second directory. The directories you specify here should contain Haskell module files that you want to import and use in GHCi.

By using the -i option followed by the directories, you are telling GHCi to include these directories in its module search path. This allows you to conveniently import and use modules that are located in those directories within the GHCi session.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ghci tool