Forrest logo
back to the ghci tool

ghci:tldr:257a4

ghci: Start a REPL and enable a language option.
$ ghci -X${language_option}
try on your machine

The command "ghci" is an acronym for "Glasgow Haskell Compiler Interpreter." It is a Haskell interpreter that allows you to evaluate Haskell expressions interactively.

The "-X" option in the command allows you to enable specific language extensions in GHCi. Language extensions provide additional features and syntax to the Haskell language.

In the command "ghci -X${language_option}", you replace "${language_option}" with the desired language extension you want to enable. For example, if you want to enable the "OverloadedStrings" extension, you would use the command "ghci -XOverloadedStrings".

Enabling language extensions with "-X" in GHCi allows you to use features or syntax that are not enabled by default in standard Haskell. It can be helpful when experimenting with new language features or working with code that requires specific extensions to compile or run correctly.

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