how to solve the problem ▸ Step by step procedures ▸ Series of statements ▸ Use case driven ▸ Defines Object ▸ May have side effects ▸ Easy to debug stepwise ▸ C++, Java, Swift
to do exactly ▸ Declare what the end result is ▸ Series of expressions ▸ Constraint driven ▸ Defines functions (first-class & higher order) ▸ Comparatively lesser side effects ▸ Same input —> same output ▸ Scala, Haskell, Lisp, Elm, Swift
Actions Update Virtual Views Model command / message updates model (ideally creates) updated model is passed to views Model: Record/Data Cmd Msg: Type update(cmd, model) -> (cmd) view(model) -> (view-msg)
a value deep inside a nested data structure, you can't simply read the value and mutate it, as you could in imperative approach ▸ If you are from OOP background: ▸ feels very restrictive ▸ for loops replaced by higher order functions DISADVANTAGES:
Experience of working in an alien for a little bit is also fruitful ▸ Learn to deal with purity, immutability (functional) ▸ Constraints will push creativity ▸ Strategies in other approaches ▸ Functional Programming is different WHY LEARN?
CwlViews: https:// www.cocoawithlove.com/blog/introducing-cwlviews.html ▸ React and Elm Inspired framework in Swift - https:// gist.github.com/inamiy/ bd257c60e670de8a144b1f97a07bacec ▸ The SAM Pattern ▸ http://sam.js.org/ (Original javascript library) ▸ https://github.com/fe9lix/SAM-Swift (Swift framework)
https:// www.youtube.com/watch?v=7TJBbUFpsvE ▸ Sam Ritchie - Using the Elm Architecture in Swift - https:// www.youtube.com/watch?v=iiXAWcNkIbw ▸ A Peek into Elm Architecture - https://www.infoq.com/ presentations/elm-architecture ▸ An Introduction to Elm's Features and Architecture - https://www.youtube.com/watch?v=vgsckgtVdoQ