A strong focus on simplicity with a concise syntax. 🎉 • No runtime exceptions (no null or unde fi ned)! • Has a friendly, time traveling, debugger! elm-lang.org alchemists.io
habitable: true} # Conditional: if planet[:habitable] "habitable" end # Result: "habitable" www.rubyist.net/~slagell/ruby/control.html ℹ Has potential to answer a nil. alchemists.io
habitable: true} # Conditional: if planet[:habitable] "habitable" else "inhabitable" end # Result: "habitable" www.rubyist.net/~slagell/ruby/control.html 💡Can be enforced by RuboCop. alchemists.io
= case planet.status of Terraforming -> "Under construction." Habitable -> "Life is good, stop by!" Barren -> "The humans are dead." elm-lang.org/docs/syntax#conditionals ℹ A `_ ->` branch can be used as a catch all (in some situations). planet = {name = "Earth", status = Habitable} alchemists.io
when :habitable "Life is good, stop by!" when :barren "The humans are dead." end www.rubyist.net/~slagell/ruby/control.html Planet = Struct.new :name, :status planet = Planet.new "Earth", :habitable alchemists.io
when :habitable "Life is good, stop by!" when :barren "The humans are dead." else fail "Unknown planet status." end www.rubyist.net/~slagell/ruby/control.html 💡Can be enforced by RuboCop. alchemists.io
0, second = 0 first + second end www.rubyist.net/~slagell/ruby/methods.html # Example 2: def add first, second return unless first && second first + second end # Example 3: def add first, second Integer(first) + Integer(second) end alchemists.io
book) • Functional Programming in Elm (online book, partially complete) 💡Read in order listed. Diving Deeper • Elm in Action by Richard Feldman - Book. $40. • Building Web Apps with Elm by The Pragmatic Studio - Screencasts. $50. • Integrating Elm by The Pragmatic Studio - Screencasts. Free. elm-lang.org/docs alchemists.io