Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 564 Bytes

COMPILE.md

File metadata and controls

17 lines (12 loc) · 564 Bytes

Compiling Haskell

To run an Haskell program, you need to:

  1. Open the terminal
  2. Compile the program with ghc -o <output name> <input name>
  3. Run the executable file with ./<output name>

You also need a main entrypoint

Of course this sounds super repetitive. In our case, we can use ghci instead:

  1. Open the terminal
  2. Run ghci to open the interactive REPL
  3. Import your module with :load <module>.hs (abbreviation: :l <module>.hs)
  4. Call the function you want to run!
  5. If you have made edits, you can reload it with :reload (:r)