O'Reilly logo

Get Programming with Haskell by Will Kurt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 34. Organizing Haskell code with modules

After reading lesson 34, you’ll be able to

  • Understand the main module implicitly used when you create a program
  • Create namespaces for your functions by using modules
  • Separate programs into multiple files
  • Selectively import functions from modules

Up to this point in the book, we’ve covered a wide range of interesting topics related to Haskell. But we haven’t discussed one of the most basic topics: creating namespaces for your functions. Haskell uses a system of modules to create separate namespaces for functions and allow you to organize your code much better. This works similarly to modules in languages such as Ruby and Python, and to packages and namespaces in languages such as Java and C#. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required