Publisher: O'Reilly Media
Final Release Date: September 2014
Pages: 210
Elixir is an excellent language if you want to learn about functional programming, and with this hands-on introduction, you’ll discover just how powerful and fun Elixir can be. This language combines the robust functional programming of Erlang with a syntax similar to Ruby, and includes powerful features for metaprogramming.
This book shows you how to write simple Elixir programs by teaching one skill at a time. Once you pick up pattern matching, process-oriented programming, and other concepts, you’ll understand why Elixir makes it easier to build concurrent and resilient programs that scale up and down with ease.
- Get comfortable with IEx, Elixir’s command line interface
- Discover atoms, pattern matching, and guards: the foundations of your program structure
- Delve into the heart of Elixir with recursion, strings, lists, and higher-order functions
- Create processes, send messages among them, and apply pattern matching to incoming messages
- Store and manipulate structured data with Erlang Term Storage and the Mnesia database
- Build resilient applications with Erlang’s Open Telecom Platform
- Define macros with Elixir’s metaprogramming tools
|
-
Chapter 1Getting Comfortable -
Installation -
Firing It Up -
First Steps -
Doing Something -
Calling Functions -
Numbers in Elixir -
Working with Variables in the Shell -
Chapter 2Functions and Modules -
Fun with fn -
And the & -
Defining Modules -
From Module to Free-Floating Function -
Splitting Code Across Modules -
Combining Functions with the Pipe Operator -
Importing Functions -
Default Values for Arguments -
Documenting Code -
Documenting Functions -
Documenting Modules -
Chapter 3Atoms, Tuples, and Pattern Matching -
Atoms -
Pattern Matching with Atoms -
Atomic Booleans -
Guards -
Underscoring That You Don’t Care -
Adding Structure: Tuples -
Chapter 4Logic and Recursion -
Logic Inside of Functions -
The Gentlest Side Effect: IO.puts -
Simple Recursion -
Chapter 5Communicating with Humans -
Strings -
Multiline Strings -
Unicode -
Character Lists -
String Sigils -
Asking Users for Information -
Chapter 6Lists -
List Basics -
Splitting Lists into Heads and Tails -
Processing List Content -
Creating Lists with Heads and Tails -
Mixing Lists and Tuples -
Building a List of Lists -
Chapter 7Name-Value Pairs -
Keyword Lists -
Lists of Tuples with Multiple Keys -
Hash Dictionaries -
From Lists to Maps -
From Maps to Structs -
Chapter 8Higher-Order Functions and List Comprehensions -
Simple Higher-Order Functions -
Creating New Lists with Higher-Order Functions -
Beyond List Comprehensions -
Chapter 9Playing with Processes -
The Shell Is a Process -
Spawning Processes from Modules -
Lightweight Processes -
Registering a Process -
When Processes Break -
Processes Talking Amongst Themselves -
Watching Your Processes -
Breaking Things and Linking Processes -
Chapter 10Exceptions, Errors, and Debugging -
Flavors of Errors -
Rescuing Code from Runtime Errors as They Happen -
Logging Progress and Failure -
Tracing Messages -
Watching Function Calls -
Writing Unit Tests -
Chapter 11Storing Structured Data -
Records: Structured Data Before structs -
Storing Data in Erlang Term Storage -
Storing Records in Mnesia -
Chapter 12Getting Started with OTP -
Creating Services with gen_server -
A Simple Supervisor -
Packaging an Application with Mix -
Chapter 13Using Macros to Extend Elixir -
Functions versus Macros -
A Simple Macro -
Creating New Logic -
Creating Functions Programatically -
When (Not) to Use Macros -
Sharing the Gospel of Elixir -
Appendix An Elixir Parts Catalog -
Shell Commands -
Reserved Words -
Operators -
Guard Components -
Common Functions -
Datatypes for Documentation and Analysis -
Appendix Generating Documentation with ExDoc -
Using ExDoc with mix |
- Title:
- Introducing Elixir
- By:
- Simon St. Laurent, J. David Eisenberg
- Publisher:
- O'Reilly Media
- Formats:
-
- Print
- Ebook
- Safari Books Online
- Print:
- September 2014
- Ebook:
- September 2014
- Pages:
- 210
- Print ISBN:
- 978-1-4493-6999-6
- | ISBN 10:
- 1-4493-6999-5
- Ebook ISBN:
- 978-1-4493-6994-1
- | ISBN 10:
- 1-4493-6994-4
|
-
Simon St. Laurent Simon St. Laurent is Senior Editor at O'Reilly Media, Inc., focusing primarily on JavaScript and web-related projects. He is co-chair of the Fluent conference. He's authored or co-authored books including Introducing Elixir, Introducing Erlang, Learning Rails 3, XML Pocket Reference, 3rd, XML: A Primer, and Cookies. You can find more of his writing on technology, Quakerism, and the Town of Dryden at simonstl.com. View Simon St. Laurent's full profile page. -
J. David Eisenberg J. David Eisenberg is a programmer and instructor living in San Jose, California. David has a talent for teaching and explaining. He has developed courses for CSS, JavaScript, CGI, and beginning XML. He also teaches C and Perl at De Anza Community College in Cupertino. David has written articles for xml.com and alisapart.com on topics such as Javascript and the Document Object Model, XML validation, XSL Transformations and Formatting Objects, and (surprise) SVG. His on-line courses provide introductory tutorials for Korean, Modern Greek, and Russian. David has also been developing education software since 1975, when he worked with the Modern Foreign Language project at the University of Illinois to develop computer-assisted instruction on the PLATO system. He co-authored several of the in-box tutorials shipped with the venerable Apple II computer. David did the programming for the multimedia CD-ROM version of a series of children's stories, and the programming for beginning Algebra and Spanish discs. When not programming, David enjoys digital photography, reading science fiction, and riding his bicycle. View J. David Eisenberg's full profile page. |
Colophon The animal on the cover of Introducing Elixir is a four-horned antelope (Tetracerus quadricornis) found in India and Nepal. Also called chousingha, these antelope are the smallest of Asian bovids, standing at 22 to 25 inches at the shoulder and weighing from 37 to 49 pounds. They have a slender build with thin legs and short tails, and a yellow-brown or reddish coat that fades to white on its underbelly and inner legs. They have a black stripe of hair that runs down each leg as well. The antelope's most distinctive features are the four horns seen on males: two between the ears, which grow in at just a few months' age, and two on the forehead, which grow in after 10 to 14 months. The front pair can reach up to 1.97 inches whereas the hind pair can grow to 3.9 inches in length. Four-horned antelope tend to live near a water supply and in areas with significant vegetation cover, such as from tall grass or heavy undergrowth. They are generally solitary animals, occasionally found in groups of up to four, and they tend to avoid human-inhabited areas. During mating season—May to July—males can become aggressive toward other males. Gestation lasts around eight months, and usually results in one or two young, which remain with their mothers for about a year, reaching sexual maturity at two years. The antelope communicate through alarm calls, which sound like a husky "phronk," and through scent marking (leaving piles of droppings to mark their territory or using large scent glands in front of their eyes to mark vegetation). Because they live in such a densely populated area of the world, the four-horned antelope's natural habitat is threatened by agricultural development. This species is listed as Vulnerable by the International Union for Conservation of Nature (IUCN) because of habitat loss. They have also become a target for trophy hunters who seek their unusual horned skull. There are estimated to be around only 10,000 individuals of this species left in the wild; many are being protected in animal conservatories. The four-horned antelope is protected under the Indian Wildlife Protection Act. The cover image is from Wood's Animate Creation. The cover fonts are URW Typewriter and Guardian Sans. The text font is Adobe Minion Pro; the heading font is Adobe Myriad Condensed; and the code font is Dalton Maag's Ubuntu Mono. |
|
Table of Contents
|
Product Details
|
About the Author
|
Colophon
|
 |
|
 |
|
|
|
Recommended for You
|
Recently Viewed
|
 |
|
By Eric A. Meyer
June 2015
Ebook
:
$11.99
Print & Ebook
:
$16.49
Print
:
$14.99
By Eric A. Meyer
August 2015
Ebook
:
$8.99
Print & Ebook
:
$10.99
Print
:
$9.99
By Eric A. Meyer
August 2013
Ebook
:
$4.99
Print & Ebook
:
$5.49
Print
:
$4.99
|
Customer Reviews
5/20/2015 4.0Interesting and concise introduction to Elixir By Farzad from Kuala Lumpur - Concise
- Easy to understand
- Helpful examples
- Well-written
4/1/2015 4.0Get started with functional programming By Pter from Dresden, Germany - Accurate
- Concise
- Easy to understand
- Helpful examples
- Well-written
11/17/2014 (1 of 1 customers found this review helpful) 5.0Ideal to get started quickly By Richard Ben Aleya from Brussels, Belgium - Accurate
- Concise
- Easy to understand
- Helpful examples
- Well-written
9/13/2014 (3 of 3 customers found this review helpful) 4.0Good Intro to a New Functional Language By Geoff the Numbers Guy from Silicon Valley, CA - Easy to understand
- Helpful examples
3/6/2014 (1 of 1 customers found this review helpful) By David L from Berkeley CA - Concise
- Easy to understand
- Helpful examples
7/20/2013 (4 of 4 customers found this review helpful) 5.0Starting off fast with Elixir By Sairam from Hyderabad, India - Easy to understand
- Helpful examples
- Well-written
|
|
|