Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Make your programs Free

2,652 views

Published on

"Make your programs free" presented at Scala Matsuri

Published in: Software
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Make your programs Free

  1. 1. Make your programs Free Pawel Szulc @rabbitonweb
  2. 2. Free Monads!
  3. 3. Free[S, A]
  4. 4. Free[S, A] This is the program
  5. 5. Free[S, A] This is the language
  6. 6. Free[S, A] This is the type of a value it will produce (once it is run)
  7. 7. Let’s see it in action! (aka Demo) https://github.com/rabbitonweb/make-your-programs-free
  8. 8. Usage of Scalaz’s Task class Task[+A](val get: Future[Throwable / A]) { .. }
  9. 9. Usage of Scalaz’s Task class Task[+A](val get: Future[Throwable / A]) { .. } def foo(input: Int): Future[String]
  10. 10. Usage of Scalaz’s Task class Task[+A](val get: Future[Throwable / A]) { .. } def foo(input: Int): Future[String] def bar(intput: Int): Task[String]
  11. 11. Usage of Scalaz’s Task class Task[+A](val get: Future[Throwable / A]) { .. } def foo(input: Int): Future[String] def bar(intput: Int): Task[String] val f: Future[String] = foo(10) val b: Task[String] = bar(20) val s1: String = b.unsafePerformSync
  12. 12. Let’s see it in action! (aka Demo) https://github.com/rabbitonweb/make-your-programs-free
  13. 13. Input - Output
  14. 14. Logging
  15. 15. Can we have both?
  16. 16. Manipulate Account
  17. 17. Introducing: low level machinery
  18. 18. Compiling down to lower-level language
  19. 19. Free[S, A]
  20. 20. But I want to see a real world example! https://github.com/quasar-analytics/quasar
  21. 21. Thank you for watching! Pawel Szulc @rabbitonweb
  22. 22. Thank you for watching! Pawel Szulc @rabbitonweb paul.szulc@gmail.com
  23. 23. Thank you for watching! Pawel Szulc @rabbitonweb paul.szulc@gmail.com http://rabbitonweb.com
  24. 24. Thank you for watching! Pawel Szulc @rabbitonweb paul.szulc@gmail.com http://rabbitonweb.com https://github.com/rabbitonweb/make-your-programs-free

×