Pro Yearly is on sale from $80 to $50! »

The FP ecosystem in Kotlin

B5ab42cbb595d2267cb2eaa050ec58c5?s=47 pakoito
September 21, 2019

The FP ecosystem in Kotlin

Arrow is a Kotlin library that has brought support for HKTs and type classes into the language. On top of that we have ported a good chunk of the FP stack including comprehensions, lenses, recursion schemes, and a blazing fast effects system. This enables experimenting with Haskell papers that you can seamlessly run on your phone.

The other aspect of Arrow is that it’s already widespread in the industry and is being used by startups and banks. It works on top of the vanilla Kotlin toolset, so it is safe to bring into your JVM programs. Bring your favorite FP constructs onto your day-to-day job!

B5ab42cbb595d2267cb2eaa050ec58c5?s=128

pakoito

September 21, 2019
Tweet

Transcript

  1. @pacoworks Paco Estevez “Stop ****ing up our language” The FP

    ecosystem in Kotlin
  2. @pacoworks Arrow: arrow-kt.io 2

  3. @pacoworks Version 0.10 - Released this month! 2.5 years running

    3
  4. @pacoworks Stop 4 First interaction with Kotlin leadership

  5. @pacoworks 5 Meme: “I’m Spanish but I haven’t come to

    talk about FP”
  6. @pacoworks Funktionale + Kategory = Arrow 6

  7. @pacoworks Tens of known Apps, as many backends Talks around

    the world Multiple books 3k Github stars 7
  8. @pacoworks Consultancies 8 Legitimate now

  9. @pacoworks What is in it? 9

  10. @pacoworks Boring libraries 10 Prelude Effect system Optics Metaprogramming utils

    soon
  11. @pacoworks Incubator libraries 11 Recursion Schemes MTL Free AQL Streams

    Collections
  12. @pacoworks Most important contribution? 12

  13. @pacoworks 13

  14. @pacoworks 14

  15. @pacoworks 15

  16. @pacoworks 16

  17. @pacoworks Arrow Docs 17

  18. 18

  19. 19

  20. @pacoworks Arrow Fx 20

  21. @pacoworks Principles 21 Based off existing research Uses coroutines Flattened

    IO combinators
  22. @pacoworks Primitives 22 fx for syntax effect to wrap !

    to compute
  23. 23

  24. @pacoworks Future of Fx 24 Bifunctor IO Reader + Bifunctor

    IO Streams
  25. @pacoworks Arrow Core 25

  26. @pacoworks Prelude I 26 Anaemic stdlib Datatypes

  27. @pacoworks Kind<F, A> 27

  28. @pacoworks F 28

  29. @pacoworks class ForList private constructor() 29

  30. @pacoworks class ForSequence private constructor() class ForOption private constructor() class

    ForTry private constructor() class ForId private constructor() class ForSet private constructor() 30
  31. @pacoworks Kind<ForOption, A> isomorphism Option<A> 31 <--- <---

  32. @pacoworks class Option<A>: Kind<ForOption, A> 32

  33. @pacoworks fun Kind<ForOption, A>.fix(): Option<A> = 33

  34. @pacoworks Extension functions are checked at compile time 34

  35. @pacoworks fun Kind<ForOption, A>.fix(): Option<A> = this as Option<A> 35

    Safe! Pinkie promise Totally ok
  36. @pacoworks Prelude II 36 Anaemic stdlib Datatypes Typeclasses

  37. @pacoworks fun <F, A, B> Kind<F, A>.map( f: (A) ->

    B, ): Kind<F, B> 37
  38. @pacoworks 38

  39. 39

  40. @pacoworks Arrow Meta 40

  41. @pacoworks Tinkering… 41 Quasiquoting Hacking the typechecker Purity checker Coherent

    typeclass implementation
  42. @pacoworks …in the real world 42 Early days Lots of

    potential experiments Focus on industrial uses
  43. @pacoworks Growing an ecosystem 43

  44. @pacoworks Letting talent flourish 44 Optics - Simon Vergauwen Recursion

    Schemes - Aedan Smith Free - Pablo Guardiola
  45. @pacoworks Sister projects 45 Ank Helios Kessel Hoplite KotlinTest

  46. @pacoworks Papers in Practice 46 The Frank language: Do be

    do be do Selective Applicative Functors Build Systems a la Carte Defunctionalized Kind Projections
  47. @pacoworks Come join us! 47

  48. @pacoworks Community ❤ gitter.im/arrow-kt/ 48 138 github contributors Gitter.im chat

    Kotlinlang slack #arrow
  49. @pacoworks Arrow: arrow-kt.io pacoworks.com @pacoworks github.com/pakoito Slides: tinyurl.com/ArrowAle19 49 Special

    thanks to all Arrow contributors & supporters!