chapter four
This chapter covers:
- Best practices in structuring programs with modules
- Using custom preludes
- Ideas and approaches behind packaging Haskell projects
- Tools for package and project management
The code in Haskell (data types, function definitions, and so on) is organized into modules. There is one special module, Prelude, that is imported into every module by default. It exports the most important definitions. Modules form packages. Packages may contain libraries intended to be used by other packages, or standalone applications, or both. There is one special package, base, which contains the definitions from the standard library (as defined by the Haskell 2010 Report, https://www.haskell.org/onlinereport/haskell2010/) together with GHC-specific additions. Many professional applications require working on many packages at the same time. So packages are organized into projects to allow application development.