Adventures in Elm GOTO Chicago, 24 May 2016
Adventures in Elm Events, Reproducibility, and Kindness question your principles
@jessitron Adventures in Elm Events, Reproducibility, and Kindness
Data Data In Out
Server UI
Everything My that Dream matters Appearance
JavaScript + React + Redux ClojureScript + Om Scala.js + React
language architecture system
undefined is not a function
“I tried over and over again to turn my self doubt into a pure functional program, and eventually, it clicked.” @mrb_bk
substring : Int -> String -> String substring qty string = … locationCode : String -> String locationCode = substring 3 peelerLocation : String peelerLocation = substring 3 "STL-48" locations : List String locations = ["STL", "ORD"]
peelerLocation : String peelerLocation = substring 3 "STL-48" peelerLocation = "STL-48" |> substring 3
g type alias LocationCode = String n i m a n locationCode : String -> String locationCode = substring 3 peelerLocation : String peelerLocation = "STL-48" |> substring 3 locations : List String locations = ["STL", "ORD"]
g type alias LocationCode = String n i m a n locationCode : String -> LocationCode locationCode = substring 3 peelerLocation : LocationCode peelerLocation = "STL-48" |> substring 3 locations : List LocationCode locations = ["STL", "ORD"]
type alias Machine = { locationCode : LocationCode records , number : Int } myPeeler : Machine myPeeler = { locationCode = "STL" , number = 48 }
expressions type alias Machine = { locationCode : LocationCode , number : Int } parse : String -> Machine parse s = let location = locationCode s num = … in { locationCode = location , number = num }
new type! type MachineDatum = Location LocationCode | Number Int machineData : List MachineDatum machineData = [ Location "STL" constructors! , Number 48 ]
pattern matching! type MachineDatum = Location LocationCode | Number Int describe : MachineDatum -> String describe datum = case datum of Location code -> "in " ++ code Number n -> "number " ++ (toString n)
Hello World
Evan Czaplicki
Hello Mouse
Hello Deeter
Deeter Clicks
model update view
small pieces encapsulated
natural extensible
server compiler package manager test tools build tools editors libraries learning community
https://derpiboo.ru/720277
elm-lang.org @jessitron http://guide.elm-lang.org/ github.com/jessitron/elm-hello-wrold github.com/satellite-of-love/landscape
modules: explicit exports, explicit dependencies packages: required docs, enforced semantic versioning types: parameterized types, type inference, aliases, unions, records
points about elm: evolution - target audience (Everyone) - narrow objective (target experience) - language system (experience) - explicitness -
what this changes: structure (framework) - larger components - global state: components can call each - others' functions standards for my experience -
predictability: reproducibility of event model - deterministic dispatch - versioning guarantees -
Explicitness Evolution Event-based Enlightenment
http://javkiller.deviantart.com/art/Library-colors-243633627 http://strachattack.deviantart.com/art/Queen-Chrysalis-493886766 http://ohemo.deviantart.com/art/Evolved-Chrysalis-493427839 http://mlp.wikia.com/wiki/Canterlot/Gallery
Recommend
More recommend