SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 a Learn Elixir at Manchester Lambda Lounge

LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 

Similar a 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
 

Más de Chi-chi Ekweozor

Más de 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
 

Último

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+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
 
%+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
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%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
 
%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
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
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...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+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...
 
%+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...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 

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