SlideShare a Scribd company logo
1 of 37
Download to read offline
Learn Elixir
Manchester Lambda Lounge, Monday 20 Feb 2017, 7pm
Presented by Chi-chi Ekweozor
@thisischichi
“Elixir is a dynamic, functional language with
Ruby-like syntax that runs on the Erlang virtual
machine. It can be described as the language
for the modern, real time, hyper-connected
world with first class support for concurrency,
fault tolerance and high availability, all courtesy
of its Erlang pedigree.”
• Elixir is a functional language. There are two
things to remember:
Immutable data: any function that transforms
data will return a new copy of it
We can combine functions, and run them in
parallel if we please, using lightweight Elixir
‘processes’
Learn Elixir
• Install Elixir
• What is pattern matching?
• Meet Lists, and Modules
• Meet the Pipe Operator |>
• Resources for learning
Install Elixir
To install Elixir on your computer, follow the
instructions at:
http://elixir-lang.org/install.html
iex - Interactive Elixir
To test your Elixir installation was successful, start
an Elixir session. At your regular shell prompt,
type iex.
Elixir Basics
Learn Elixir
• Install Elixir
• What is pattern matching?
• Meet Lists, and Modules
• Meet the Pipe Operator |>
• Resources for learning
Pattern matching?
Type this into your terminal:
iex> a = 1
iex> a + 3
Now, type this into your terminal:
iex> a = 1
iex> 1 = a
iex> 2 = a
Lists, and pattern matching:
iex> list = [ 1, 2, 3 ]
iex> [ a, b, c ] = list
iex> a, iex> b, etc etc
More lists:
iex> list = [ 1, 2, 3 ]
iex> [ a, 2, b ] = list
iex> a, iex> b, etc etc
There’s more to this than might be
immediately apparent:
iex> list = [ 1, 2, 3 ]
iex> [ a, 1, b ] = list
Learn Elixir
• Install Elixir
• What is pattern matching?
• Meet Lists, and Modules
• Meet the Pipe Operator |>
• Resources for learning
Now meet Modules
clause
Learn Elixir
• Install Elixir
• What is pattern matching?
• Meet Lists, and Modules
• Meet the Pipe Operator |>
• Resources for learning
The Pipe Operator |>
We’ve all seen code like this:
people = DB.find_customers
orders = Orders.for_customers(people)
tax = sales_tax(orders, 2016)
filing = prepare_filing(tax)
The alternative was to write:
filing = prepare_filing(sales_tax(Orders.for_customers(DB.find_customers),
2016))
Elixir has a better way of writing it…
The Pipe or Pipeline Operator |>
takes the result of the previous
expression and feeds it to the next
one as the first argument
In Elixir, the awkward to read function becomes:
filing = DB.find_customers
|> Orders.for_customers
|> sales_tax(2016)
|> prepare_filing
Putting it all together, a |> exercise:
Learn Elixir
• Install Elixir
• What is pattern matching?
• Meet Lists, and Modules
• Meet the Pipe Operator |>
• Resources for learning
Learning Resources
Books:
Programming Elixir 1.3 by Dave Thomas
Elixir in Action by Saša Jurić
Websites:
elixir-lang.org
elixirforum.com
elixirschool.com

More Related Content

What's hot

Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012
Sri Kanth
 

What's hot (20)

Building Elixir App Release with Distillery and Docker
Building Elixir App Release with Distillery and DockerBuilding Elixir App Release with Distillery and Docker
Building Elixir App Release with Distillery and Docker
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
Voice Interfaces Usergroup Berlin - 05-10-2016 : Kay Lerch on Morse-Coder skill
Voice Interfaces Usergroup Berlin - 05-10-2016 : Kay Lerch on Morse-Coder skillVoice Interfaces Usergroup Berlin - 05-10-2016 : Kay Lerch on Morse-Coder skill
Voice Interfaces Usergroup Berlin - 05-10-2016 : Kay Lerch on Morse-Coder skill
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and Web
 
Elixir Programming Language 101
Elixir Programming Language 101Elixir Programming Language 101
Elixir Programming Language 101
 
Actor model : A Different Concurrency Approach
Actor model : A Different Concurrency ApproachActor model : A Different Concurrency Approach
Actor model : A Different Concurrency Approach
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Elixir for Rubyists
Elixir for RubyistsElixir for Rubyists
Elixir for Rubyists
 
Akka Fundamentals
Akka FundamentalsAkka Fundamentals
Akka Fundamentals
 
Building a chatbot – step by step
Building a chatbot – step by stepBuilding a chatbot – step by step
Building a chatbot – step by step
 
Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012
 
Nice performance using Sf2 cache wrapping Sf1 application
Nice performance using Sf2 cache wrapping Sf1 applicationNice performance using Sf2 cache wrapping Sf1 application
Nice performance using Sf2 cache wrapping Sf1 application
 
Debugging ansible modules
Debugging ansible modulesDebugging ansible modules
Debugging ansible modules
 
DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves Elixir
 
Learning Elixir as a Rubyist
Learning Elixir as a RubyistLearning Elixir as a Rubyist
Learning Elixir as a Rubyist
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby Apps
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015
 

Viewers also liked

Bottleneck in Elixir Application - Alexey Osipenko
 Bottleneck in Elixir Application - Alexey Osipenko  Bottleneck in Elixir Application - Alexey Osipenko
Bottleneck in Elixir Application - Alexey Osipenko
Elixir Club
 

Viewers also liked (20)

Bottleneck in Elixir Application - Alexey Osipenko
 Bottleneck in Elixir Application - Alexey Osipenko  Bottleneck in Elixir Application - Alexey Osipenko
Bottleneck in Elixir Application - Alexey Osipenko
 
Elixir basics-2
Elixir basics-2Elixir basics-2
Elixir basics-2
 
Elixir intro
Elixir introElixir intro
Elixir intro
 
Elixir & Phoenix 推坑
Elixir & Phoenix 推坑Elixir & Phoenix 推坑
Elixir & Phoenix 推坑
 
Elixir basics
Elixir basicsElixir basics
Elixir basics
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)
 
Elixir and Dialyzer, Types and Typespecs, using and understanding them
Elixir and Dialyzer, Types and Typespecs, using and understanding themElixir and Dialyzer, Types and Typespecs, using and understanding them
Elixir and Dialyzer, Types and Typespecs, using and understanding them
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
The Magic Of Elixir
The Magic Of ElixirThe Magic Of Elixir
The Magic Of Elixir
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to Elixir
 
A Brief Introduction To Erlang
A Brief Introduction To ErlangA Brief Introduction To Erlang
A Brief Introduction To Erlang
 
BioContainers on ELIXIR All Hands 2017
BioContainers on ELIXIR All Hands 2017BioContainers on ELIXIR All Hands 2017
BioContainers on ELIXIR All Hands 2017
 
QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战
 
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
 
Elixir - Easy fun for busy developers @ Devoxx 2016
Elixir - Easy fun for busy developers @ Devoxx 2016Elixir - Easy fun for busy developers @ Devoxx 2016
Elixir - Easy fun for busy developers @ Devoxx 2016
 
Java 与 CPU 高速缓存
Java 与 CPU 高速缓存Java 与 CPU 高速缓存
Java 与 CPU 高速缓存
 
Phoenix demysitify, with fun
Phoenix demysitify, with funPhoenix demysitify, with fun
Phoenix demysitify, with fun
 
Elixir
ElixirElixir
Elixir
 
Elixir and OTP
Elixir and OTPElixir and OTP
Elixir and OTP
 
Spark as a distributed Scala
Spark as a distributed ScalaSpark as a distributed Scala
Spark as a distributed Scala
 

Similar to Learn Elixir at Manchester Lambda Lounge

LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 

Similar to Learn Elixir at Manchester Lambda Lounge (20)

Elixir
ElixirElixir
Elixir
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
 
Rails Tips and Best Practices
Rails Tips and Best PracticesRails Tips and Best Practices
Rails Tips and Best Practices
 
From Ruby to Elixir
From Ruby to ElixirFrom Ruby to Elixir
From Ruby to Elixir
 
Playing with Elixir/Phoenix
Playing with Elixir/PhoenixPlaying with Elixir/Phoenix
Playing with Elixir/Phoenix
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigou
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
 
Automation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in DockerAutomation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in Docker
 
Web APIs: The future of software
Web APIs: The future of softwareWeb APIs: The future of software
Web APIs: The future of software
 
Road to Dynamic LINQ Part 1
Road to Dynamic LINQ Part 1Road to Dynamic LINQ Part 1
Road to Dynamic LINQ Part 1
 
20240412 QFM010 Elixir Reading List March 2024
20240412 QFM010 Elixir Reading List March 202420240412 QFM010 Elixir Reading List March 2024
20240412 QFM010 Elixir Reading List March 2024
 
Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...
Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...
Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to Elixir
 
Introduction to .Net
Introduction to .NetIntroduction to .Net
Introduction to .Net
 
The Ring programming language version 1.5.4 book - Part 6 of 185
The Ring programming language version 1.5.4 book - Part 6 of 185The Ring programming language version 1.5.4 book - Part 6 of 185
The Ring programming language version 1.5.4 book - Part 6 of 185
 
An introduction . Programmatic access to interaction resources
An introduction. Programmatic access to interaction resourcesAn introduction. Programmatic access to interaction resources
An introduction . Programmatic access to interaction resources
 
Amazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex WorkshopAmazon Polly and Amazon Lex Workshop
Amazon Polly and Amazon Lex Workshop
 

More from Chi-chi Ekweozor

More from Chi-chi Ekweozor (10)

Ladies that UX MCR - April 2017 - Lightning Talk
Ladies that UX MCR - April 2017 - Lightning Talk Ladies that UX MCR - April 2017 - Lightning Talk
Ladies that UX MCR - April 2017 - Lightning Talk
 
Manchester Social Media Surgery Events: an Introduction
Manchester Social Media Surgery Events: an IntroductionManchester Social Media Surgery Events: an Introduction
Manchester Social Media Surgery Events: an Introduction
 
The Web Is Your Oyster
The Web Is Your OysterThe Web Is Your Oyster
The Web Is Your Oyster
 
WordCampUK 2009 - Building Audience And Community
WordCampUK 2009 - Building Audience And CommunityWordCampUK 2009 - Building Audience And Community
WordCampUK 2009 - Building Audience And Community
 
7W7D Update June
7W7D Update June7W7D Update June
7W7D Update June
 
The Importance Of Online Marketing
The Importance Of Online MarketingThe Importance Of Online Marketing
The Importance Of Online Marketing
 
A Beginner's Guide to Social Media
A Beginner's Guide to Social MediaA Beginner's Guide to Social Media
A Beginner's Guide to Social Media
 
Social Networking: How Can Your Business Benefit?
Social Networking: How Can Your Business Benefit?Social Networking: How Can Your Business Benefit?
Social Networking: How Can Your Business Benefit?
 
Online Film Distribution
Online Film DistributionOnline Film Distribution
Online Film Distribution
 
The New Digital Marketing Mix: Breathe Creativity
The New Digital Marketing Mix: Breathe CreativityThe New Digital Marketing Mix: Breathe Creativity
The New Digital Marketing Mix: Breathe Creativity
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

Learn Elixir at Manchester Lambda Lounge

  • 1. Learn Elixir Manchester Lambda Lounge, Monday 20 Feb 2017, 7pm Presented by Chi-chi Ekweozor @thisischichi
  • 2. “Elixir is a dynamic, functional language with Ruby-like syntax that runs on the Erlang virtual machine. It can be described as the language for the modern, real time, hyper-connected world with first class support for concurrency, fault tolerance and high availability, all courtesy of its Erlang pedigree.”
  • 3. • Elixir is a functional language. There are two things to remember: Immutable data: any function that transforms data will return a new copy of it We can combine functions, and run them in parallel if we please, using lightweight Elixir ‘processes’
  • 4. Learn Elixir • Install Elixir • What is pattern matching? • Meet Lists, and Modules • Meet the Pipe Operator |> • Resources for learning
  • 6. To install Elixir on your computer, follow the instructions at: http://elixir-lang.org/install.html
  • 7. iex - Interactive Elixir To test your Elixir installation was successful, start an Elixir session. At your regular shell prompt, type iex.
  • 9. Learn Elixir • Install Elixir • What is pattern matching? • Meet Lists, and Modules • Meet the Pipe Operator |> • Resources for learning
  • 11. Type this into your terminal: iex> a = 1 iex> a + 3
  • 12. Now, type this into your terminal: iex> a = 1 iex> 1 = a iex> 2 = a
  • 13. Lists, and pattern matching: iex> list = [ 1, 2, 3 ] iex> [ a, b, c ] = list iex> a, iex> b, etc etc
  • 14. More lists: iex> list = [ 1, 2, 3 ] iex> [ a, 2, b ] = list iex> a, iex> b, etc etc
  • 15. There’s more to this than might be immediately apparent: iex> list = [ 1, 2, 3 ] iex> [ a, 1, b ] = list
  • 16. Learn Elixir • Install Elixir • What is pattern matching? • Meet Lists, and Modules • Meet the Pipe Operator |> • Resources for learning
  • 18.
  • 19.
  • 20.
  • 21.
  • 23.
  • 24.
  • 25. Learn Elixir • Install Elixir • What is pattern matching? • Meet Lists, and Modules • Meet the Pipe Operator |> • Resources for learning
  • 27. We’ve all seen code like this: people = DB.find_customers orders = Orders.for_customers(people) tax = sales_tax(orders, 2016) filing = prepare_filing(tax)
  • 28. The alternative was to write: filing = prepare_filing(sales_tax(Orders.for_customers(DB.find_customers), 2016))
  • 29. Elixir has a better way of writing it…
  • 30. The Pipe or Pipeline Operator |> takes the result of the previous expression and feeds it to the next one as the first argument
  • 31. In Elixir, the awkward to read function becomes:
  • 32. filing = DB.find_customers |> Orders.for_customers |> sales_tax(2016) |> prepare_filing
  • 33. Putting it all together, a |> exercise:
  • 34.
  • 35. Learn Elixir • Install Elixir • What is pattern matching? • Meet Lists, and Modules • Meet the Pipe Operator |> • Resources for learning
  • 37. Books: Programming Elixir 1.3 by Dave Thomas Elixir in Action by Saša Jurić Websites: elixir-lang.org elixirforum.com elixirschool.com