Book Image

Elixir Cookbook

By : Paulo Pereira
Book Image

Elixir Cookbook

By: Paulo Pereira

Overview of this book

Table of Contents (16 chapters)
Elixir Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Modules and Functions

This chapter will cover the following recipes:

  • Namespacing modules

  • Using module attributes as constants

  • Enforcing behaviors

  • Documenting modules

  • Using module directives

  • Using a module in the scripted mode

  • Defining functions with default arguments

  • Using guard clauses and pattern matching in function definitions