:run commands are for testing command-line applications.
The simplest example is
:main with no arguments. If you have defined an action called
main, then the
:main command will run it.
This may not be very interesting, because this is not any different from what happens if we just asked GHCi to run the
main command directly.Notice that we have removed the colon in this second example, so here we not using a GHCi command.
:main command gets more interesting when we have a program that reads its command-line arguments. A program does this using the following action from the