Introducing Elixir: Getting Started in Functional Programming

Front Cover
"O'Reilly Media, Inc.", Sep 10, 2014 - Computers - 210 pages

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
 

Contents

Chapter 1 Getting Comfortable
1
Chapter 2 Functions and Modules
11
Chapter 3 Atoms Tuples and Pattern Matching
25
Chapter 4 Logic and Recursion
37
Chapter 5 Communicating with Humans
51
Chapter 6 Lists
61
Chapter 7 NameValue Pairs
73
Chapter 8 HigherOrder Functions and List Comprehensions
87
Chapter 10 Exceptions Errors and Debugging
119
Chapter 11 Storing Structured Data
131
Chapter 12 Getting Started with OTP
153
Chapter 13 Using Macros to Extend Elixir
167
Appendix A An Elixir Parts Catalog
175
Appendix B Generating Documentation with ExDoc
183
Index
187
About the Authors
193

Chapter 9 Playing with Processes
97

Other editions - View all

Common terms and phrases

About the author (2014)

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. 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.

Bibliographic information