Successfully reported this slideshow.
Your SlideShare is downloading. ×

Functional Reactive Programming avec RxSwift

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
FRP
FRP
Loading in …3
×

Check these out next

1 of 31 Ad

Functional Reactive Programming avec RxSwift

Download to read offline

Slides de ma conférence donnée à Cocoaheads Strasbourg en mai 2017 sur la programmation fonctionnelle réactive en swift (avec la librairie RxSwift).

Retrouvez le code de la démo ici: https://github.com/nverinaud/prez-frp-cocoaheads-may-2017

Slides de ma conférence donnée à Cocoaheads Strasbourg en mai 2017 sur la programmation fonctionnelle réactive en swift (avec la librairie RxSwift).

Retrouvez le code de la démo ici: https://github.com/nverinaud/prez-frp-cocoaheads-may-2017

Advertisement
Advertisement

More Related Content

Similar to Functional Reactive Programming avec RxSwift (20)

Advertisement

Recently uploaded (20)

Advertisement

Functional Reactive Programming avec RxSwift

  1. 1. Functional Reactive Programming avec RxSwift Cocoaheads Strasbourg Mai 2017 Nicolas VERINAUD
  2. 2. Freelance Formateur Développeur iOS depuis 2011 Prog. Fonctionnelle (yay F# !) Qui suis-je ? @nverinaud
  3. 3. ≠ OOP Composition > Héritage Fonctions en paramètre (closures) Immuabilité Functional Programming
  4. 4. Réagir aux changements d’états Délégation Closures Notifications (😨) KVO (🤢) Reactive Programming
  5. 5. Réagir aux changements d’états Délégation [implicite] Closures [implicite] Notifications (😨) [implicite] KVO (🤢) [implicite] Reactive Programming
  6. 6. “Explicit is better than implicit.” –The Zen of Python
  7. 7. Observable<T>
  8. 8. Une valeur qui change au cours du temps. Observable<T>
  9. 9. Push ≠ Pull (Sequence) Observable<T>
  10. 10. protocol Observable<T> { func subscribe(_ observer: Observer<T>) -> Disposable } Observable<T>
  11. 11. protocol Observer<T> { func onNext(_ element: T) func onError(_ error: Error) func onCompleted() } Observable<T>
  12. 12. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> How ?
  13. 13. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> Avec map ! Monad in disguise…psshh
  14. 14. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> func map(_ transform: (A -> B)) -> Observable<B>
  15. 15. Observable<T> // strings: Observable<String> let isEmpty = strings.map { $0.isEmpty }
  16. 16. Observable<T> Demo !
  17. 17. RxSwift ou ReactiveCocoa ?
  18. 18. RxSwift 👍 Respectueux des interfaces Rx originales 👎 Pas de typage pour Error
  19. 19. ReactiveCocoa 👍 Typage de Error 👍 Distinction Hot et Cold 👎 Concepts ≠ Rx (Signal)
  20. 20. One more thing…
  21. 21. “No Silver Bullet” –Fred Brooks
  22. 22. “Reactive is dead, long live tasteful composition of side effects.” –Erik Meijer
  23. 23. One Many Sync T Sequence Async Future<T> Observable<T> Tasteful Side Effects
  24. 24. Tasteful Side Effects Future<Option<Array<String>>> Result<Observable<String>> etc…
  25. 25. Tasteful Side Effects Future<Option<Array<String>>> Result<Observable<String>> etc… Soyez explicites !
  26. 26. Aller plus loin… ReactiveX.io IntroToRx.com React 2014 : Erik Meijer - What does it mean to be Reactive?
  27. 27. Merci ! @nverinaud n.verinaud@gmail.com nverinaud.com
  28. 28. Bibliographie Kaa - http://www.abadinte.com/wp-content/ uploads/2014/09/Kaa-aie-confiance.jpg Fred Brooks Wikipedia - https:// fr.m.wikipedia.org/wiki/Frederick_Brooks Erik Meijer Wikipedia - https://en.wikipedia.org/ wiki/Erik_Meijer_%28computer_scientist%29 React 2014 : Erik Meijer - What does it mean to be Reactive? Meme Generator - memegenerator.net

×