Loading Modules into GHCi
Before we move on, let's see how we can load modules we create into GHCi, so that we can use any functions we define. We create a new file, e.g. Practice.hs
, and define our module in there (remember, the module name should match the file name), and define our triple
function from before:
We can now launch GHCi from the terminal and load our module using its relative file path using :load
, making the function available for use:
Last updated