12CREATING STAND-ALONE PROGRAMS

Image

Up to this point, we’ve used GHCi to do all of our calculations and to show us the results. We’ve written fairly sophisticated source code files, but we’ve always loaded them into GHCi to use their functions. Haskell, however, is a full-featured, production-ready computer language, and it’s completely capable of compiling stand-alone programs that don’t require any GHCi involvement. The animations in Chapter 13 and later chapters are best carried out using stand-alone programs rather than GHCi.

This chapter explains three different ways to make a stand-alone (executable) program. The most basic way uses ghc to produce ...

Get Learn Physics with Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.