Upload
thomas-coopman
View
209
Download
0
Embed Size (px)
Citation preview
Why shouldyou care?
A really nice languageA nice introduction into functional
programmingNice and helping community
Any reasonwhy not?
It's new (version 0.16)This means there are some quirksBut these are things being worked on
(for example in 0.17)You have to find out things for yourself
-- Any live cell with fewer than two live neighbours dies, as if caused by under-population.underPopulationRule:Cell->Neighbours->LifeCycleunderPopulationRulecellneighbours=casecellofAlive->ifnumberOfLiveneighbours<2thenDies
elseSame
Dead->Same
-- Any live cell with two or three live neighbours lives on to the next generation.livesOnRule:Cell->Neighbours->LifeCyclelivesOnRulecellneighbours=casecellofAlive->letnumberOfLiveNeighbours=numberOfLiveneighbours
inif((numberOfLiveNeighbours==2)||(numberOfLiveNeighbours==3))thenSame
elseDies
Dead->Same
typeTreea=Empty|Nodea(Treea)(Treea)
empty:Treeaempty=
Empty
singleton:a->Treeasingletonv=
NodevEmptyEmpty
insert:comparable->Treecomparable->Treecomparableinsertxtree=
casetreeofEmpty->
singletonx
Nodeyleftright->ifx>ythen
Nodeyleft(insertxright)
elseifx<ythenNodey(insertxleft)right
elsetree
ResourcesElmElm-cssawesome-elm resourceselm tutorialTest runnersource to slides