SlideShare a Scribd company logo
An introduction to Elm
by @tcoopman
Some examples
Why should I care?
What is Elm
Introduction and examples
Questions, discussions,...
Why should
you care?
A really nice language
A nice introduction into functional
programming
Nice and helping community
Any reason
why not?
It's new (version 0.16)
This means there are some quirks
But these are things being worked on
(for example in 0.17)
You have to find out things for yourself
So should
you care?
YES!
OF
COURSE!
Elmcreated by Evan Czaplicki @czaplic
Why are we
doing slides?
SHOW
ME THE
CODE!
-- Any live cell with fewer than two live neighbours dies, as if caused by under-popu
underPopulationRule : Cell -> Neighbours -> LifeCycle
underPopulationRule cell neighbours =
case cell of
Alive ->
if numberOfLive neighbours < 2 then
Dies
else
Same
Dead ->
Same
-- Any live cell with two or three live neighbours lives on to the next generation.
livesOnRule : Cell -> Neighbours -> LifeCycle
livesOnRule cell neighbours =
case cell of
Alive ->
let
numberOfLiveNeighbours = numberOfLive neighbours
in
if ((numberOfLiveNeighbours == 2) || (numberOfLiveNeighbours == 3)) then
Same
else
Dies
Dead ->
Same
type Tree a
= Empty
| Node a (Tree a) (Tree a)
empty : Tree a
empty =
Empty
singleton : a -> Tree a
singleton v =
Node v Empty Empty
insert : comparable -> Tree comparable -> Tree comparable
insert x tree =
case tree of
Empty ->
singleton x
Node y left right ->
if x > y then
Node y left (insert x right)
else if x < y then
Node y (insert x left) right
else
tree
Resources
Elm
Elm-css
awesome-elm resources
elm tutorial
Test runner
source to slides

More Related Content

Viewers also liked

PP How College Students View Interracial and Interethnic Relationships
PP How College Students View Interracial and Interethnic RelationshipsPP How College Students View Interracial and Interethnic Relationships
PP How College Students View Interracial and Interethnic RelationshipsRachel Woodward
 
Marketing fan
Marketing fanMarketing fan
Marketing fan
Claudia Lluncor
 
Tugas hormon (fitriyani thamrin G2 L1 15 012)
Tugas hormon (fitriyani thamrin G2 L1 15 012)Tugas hormon (fitriyani thamrin G2 L1 15 012)
Tugas hormon (fitriyani thamrin G2 L1 15 012)
Fitriyani_Thamrin_Mardhan
 
Museo de la catedral
Museo de la catedralMuseo de la catedral
Museo de la catedral
UNACH .
 
Dialnet formas deintegraciondelasempresas-4021250
Dialnet formas deintegraciondelasempresas-4021250Dialnet formas deintegraciondelasempresas-4021250
Dialnet formas deintegraciondelasempresas-4021250
joel ccamapaza almanza
 
Museu
MuseuMuseu

Viewers also liked (9)

PP How College Students View Interracial and Interethnic Relationships
PP How College Students View Interracial and Interethnic RelationshipsPP How College Students View Interracial and Interethnic Relationships
PP How College Students View Interracial and Interethnic Relationships
 
Marketing fan
Marketing fanMarketing fan
Marketing fan
 
Nicole Resume
Nicole ResumeNicole Resume
Nicole Resume
 
Tugas hormon (fitriyani thamrin G2 L1 15 012)
Tugas hormon (fitriyani thamrin G2 L1 15 012)Tugas hormon (fitriyani thamrin G2 L1 15 012)
Tugas hormon (fitriyani thamrin G2 L1 15 012)
 
UF News, 04-21-03
UF News, 04-21-03UF News, 04-21-03
UF News, 04-21-03
 
Museo de la catedral
Museo de la catedralMuseo de la catedral
Museo de la catedral
 
Dialnet formas deintegraciondelasempresas-4021250
Dialnet formas deintegraciondelasempresas-4021250Dialnet formas deintegraciondelasempresas-4021250
Dialnet formas deintegraciondelasempresas-4021250
 
0370_001
0370_0010370_001
0370_001
 
Museu
MuseuMuseu
Museu
 

Recently uploaded

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 

Recently uploaded (20)

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 

Elm session socrates

  • 1. An introduction to Elm by @tcoopman
  • 2.
  • 3. Some examples Why should I care? What is Elm Introduction and examples Questions, discussions,...
  • 4.
  • 5. Why should you care? A really nice language A nice introduction into functional programming Nice and helping community
  • 6. Any reason why not? It's new (version 0.16) This means there are some quirks But these are things being worked on (for example in 0.17) You have to find out things for yourself
  • 8. Elmcreated by Evan Czaplicki @czaplic
  • 9. Why are we doing slides? SHOW ME THE CODE!
  • 10. -- Any live cell with fewer than two live neighbours dies, as if caused by under-popu underPopulationRule : Cell -> Neighbours -> LifeCycle underPopulationRule cell neighbours = case cell of Alive -> if numberOfLive neighbours < 2 then Dies else Same Dead -> Same -- Any live cell with two or three live neighbours lives on to the next generation. livesOnRule : Cell -> Neighbours -> LifeCycle livesOnRule cell neighbours = case cell of Alive -> let numberOfLiveNeighbours = numberOfLive neighbours in if ((numberOfLiveNeighbours == 2) || (numberOfLiveNeighbours == 3)) then Same else Dies Dead -> Same
  • 11. type Tree a = Empty | Node a (Tree a) (Tree a) empty : Tree a empty = Empty singleton : a -> Tree a singleton v = Node v Empty Empty insert : comparable -> Tree comparable -> Tree comparable insert x tree = case tree of Empty -> singleton x Node y left right -> if x > y then Node y left (insert x right) else if x < y then Node y (insert x left) right else tree
  • 12.
  • 13.
  • 14.