![Forrest logo](/images/logo.png)
ghci:tldr:1f7bb
ghci: Start a REPL and enable some level of compiler warnings (e.g. `all` or `compact`).
$ ghci -W${warning_level}
try on your machine
The command "ghci -W${warning_level}" is used to start the GHCi (Glasgow Haskell Compiler interactive) shell with a specific warning level enabled.
In Haskell, compiler warnings can help identify potential issues or suboptimal code. The "-W" flag is used to enable warnings, and "${warning_level}" is a placeholder for the desired level of warnings.
The warning level can be one of the following:
- "none": No warnings are enabled.
- "error": Treat warnings as errors, causing the compilation to fail.
- "warn": Show all warnings without treating them as errors.
- "warn+deprecations": Show all warnings and deprecations without treating them as errors.
- "warn+deprecations+suggestions": Show all warnings, deprecations, and suggestions without treating them as errors.
By specifying the desired warning level after "-W", you can customize the type and severity of warnings shown in the GHCi shell.
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.