Creating Your Own Modules
Importing modules defined by libraries is a great starting point when you are building an application, but as your programs start to grow larger, you’ll also quickly realize that you’ll need to use them in your own application to help you organize and re-use your own code. Modules are the basic unit of organization in Haskell applications, and in this section, you’ll learn how to write modules, control what they export, and how to design an application to make the best use of modules so that your code is easy to use and re-use.
Let’s start by looking at how we can create a module. Haskell modules are closely related to individual source files. Each file contains one module, and each module is defined by a single file. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access