Elixir Cookbook

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

Elixir Cookbook

Paulo A Pereira

2 customer reviews
Unleash the full power of programming in Elixir with over 60 incredibly effective recipes
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.90
RRP $26.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.90
$44.99
$29.99 p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Elixir Cookbook Book Cover
Elixir Cookbook
$ 26.99
$ 18.90
Robot Operating System Cookbook Book Cover
Robot Operating System Cookbook
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $31.98
Add to Cart

Book Details

ISBN 139781784397517
Paperback236 pages

Book Description

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.

Table of Contents

Chapter 1: Command Line
Introduction
Using the terminal to prototype and test ideas
Loading and compiling modules
Getting help and accessing documentation within IEx
Using Erlang from Elixir
Inspecting your system in IEx
Inspecting your system with Observer
Creating a simple application
Managing dependencies
Generating a supervised application
Generating umbrella applications
Managing application configuration
Creating custom Mix tasks
Chapter 2: Data Types and Structures
Understanding immutability
Adding and subtracting lists
Combining tuples into a list
Creating and manipulating keyword lists
Using pattern matching
Pattern matching an HTTPoison response
Creating a key/value store with a map
Mapping and reducing enumerables
Generating lazy (even infinite) sequences
Streaming a file as a resource
Chapter 3: Strings and Binaries
Introduction
Joining strings
Splitting strings
Replacing string codepoints with patterns
Slicing strings with ranges
Using regular expressions
Combining operations with the |> operator
Creating a word list
Determining the word frequency in a text
Reading and writing metadata from MP3 files
Chapter 4: Modules and Functions
Introduction
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
Chapter 5: Processes and Nodes
Introduction
Sending messages between processes
Making code run on all available CPUs
Using tasks to perform multiple concurrent computations
Creating a stateful server process (messages with counters)
Using agents as an abstraction around states
Using an ETS table to share the state
Creating named nodes
Connecting nodes
Executing code in a different node
Chapter 6: OTP – Open Telecom Platform
Introduction
Implementing a GenServer
Expanding our server
Creating a supervisor
Using Observer to inspect supervisors and processes
Handling errors and managing exceptions
Packaging and releasing an OTP application
Deploying applications and updating a running system
Chapter 7: Cowboy and Phoenix
Introduction
Setting up Cowboy
Serving static files
Implementing a websocket handler
Creating a Phoenix application
Defining routes
Creating a controller
Creating views and templates
Implementing topics
Protecting the Phoenix app with SSL
Chapter 8: Interactions
Introduction
Using Redis and Postgres
Using OS commands from within Elixir
Getting Twitter data

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

Authors

Table of Contents

Chapter 1: Command Line
Introduction
Using the terminal to prototype and test ideas
Loading and compiling modules
Getting help and accessing documentation within IEx
Using Erlang from Elixir
Inspecting your system in IEx
Inspecting your system with Observer
Creating a simple application
Managing dependencies
Generating a supervised application
Generating umbrella applications
Managing application configuration
Creating custom Mix tasks
Chapter 2: Data Types and Structures
Understanding immutability
Adding and subtracting lists
Combining tuples into a list
Creating and manipulating keyword lists
Using pattern matching
Pattern matching an HTTPoison response
Creating a key/value store with a map
Mapping and reducing enumerables
Generating lazy (even infinite) sequences
Streaming a file as a resource
Chapter 3: Strings and Binaries
Introduction
Joining strings
Splitting strings
Replacing string codepoints with patterns
Slicing strings with ranges
Using regular expressions
Combining operations with the |> operator
Creating a word list
Determining the word frequency in a text
Reading and writing metadata from MP3 files
Chapter 4: Modules and Functions
Introduction
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
Chapter 5: Processes and Nodes
Introduction
Sending messages between processes
Making code run on all available CPUs
Using tasks to perform multiple concurrent computations
Creating a stateful server process (messages with counters)
Using agents as an abstraction around states
Using an ETS table to share the state
Creating named nodes
Connecting nodes
Executing code in a different node
Chapter 6: OTP – Open Telecom Platform
Introduction
Implementing a GenServer
Expanding our server
Creating a supervisor
Using Observer to inspect supervisors and processes
Handling errors and managing exceptions
Packaging and releasing an OTP application
Deploying applications and updating a running system
Chapter 7: Cowboy and Phoenix
Introduction
Setting up Cowboy
Serving static files
Implementing a websocket handler
Creating a Phoenix application
Defining routes
Creating a controller
Creating views and templates
Implementing topics
Protecting the Phoenix app with SSL
Chapter 8: Interactions
Introduction
Using Redis and Postgres
Using OS commands from within Elixir
Getting Twitter data

Book Details

ISBN 139781784397517
Paperback236 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Learning Elixir Book Cover
Learning Elixir
$ 27.99
$ 19.60
Data Visualization with D3.js Cookbook Book Cover
Data Visualization with D3.js Cookbook
$ 26.99
$ 18.90
Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 25.20
Mastering Clojure Book Cover
Mastering Clojure
$ 39.99
$ 28.00
Go Programming Blueprints - Second Edition Book Cover
Go Programming Blueprints - Second Edition
$ 39.99
$ 28.00
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80