Elixir Cookbook

Paulo A Pereira


Unleash the full power of programming in Elixir with over 60 incredibly effective recipes

About This Book

  • Use Elixir to solve common problems associated with scalability, concurrency, fault tolerance, and high availability
  • From command line to external API interaction, experience the joy of using this new language
  • Explore the concepts of data structures, immutability, and data transformation with the help of practical recipes

Who This Book Is For

This book is intended for users with some knowledge of the Elixir language syntax and basic data types/structures. Although this is a cookbook and no sequential reading is required, the book's structure will allow less advanced users who follow it to be gradually exposed to some of Elixir's features and concepts specific to functional programming. To get the most out of this book, you need to be well versed with Erlang.

What You Will Learn

  • Utilize Erlang code seamlessly from Elixir, leveraging a huge amount of battle-tested libraries
  • Use the Mix tool to generate applications and manage dependencies
  • Create modules and functions and use them from different machines, taking advantage of Elixir's integrated distribution mechanism
  • Implement OTP behaviors in Elixir
  • Package and deploy applications on running systems
  • Work with the Phoenix framework to generate a basic web application
  • Interact with external programs and APIs
  • Serve static files and implement websockets

In Detail

This book is a set of recipes grouped by topic that acts as a good reference to get ideas from or to quickly search for a solution to a problem. You will begin by launching an IEx session and using it to test some ideas. Next, you will perform various operations like loading and compiling modules, inspecting your system, generating a supervised app, and so on. Furthermore, you will be introduced to immutability, working with data structures, performing pattern matching, and using stream modules to generate infinite data sequences. You will learn about everything from joining strings to determining the word frequency in text. With respect to modules and functions, you will also discover how to load code from other modules and use guards and pattern matching in functions.