Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ねことはじめる関数型 / functional programming with cats

Avatar for ぷに ぷに
February 29, 2020

ねことはじめる関数型 / functional programming with cats

VRC LT #7

Avatar for ぷに

ぷに

February 29, 2020
Tweet

More Decks by ぷに

Other Decks in Technology

Transcript

  1. ͜͡͠ΐ͏͔͍ ͳ·͑ɿ΀ʹ VRC ID : ehlfin_puni Twitter : punilfin 2020/02/10

    ʹ VRC ʹ͖·ͨ͠ ͠ΐ͠Μ͠ΌͰ͢ɽ΍ͯ͘͞͠͠Ͷ ͖͢ɿ͢͏͕͘ ͖͚ͩ͢Ͳͳʹ΋Θ͔Βͳ͍Ͱ͢ɽ΍ͯ͘͞͠͠Ͷ ͖͢͡Όͳ͍ɿ΀Ζ͙ΒΈΜ͙ ͱ ͖͔͍͕͘͠Ύ͏ ͱ͘ʹ͖Β͍ɿ JavaScript
  2. ͍·͔Β Scala with Cats ͱ͍͏ຊͷ࿩Λ͠·͢ Cats Λμγʹͯؔ͠਺ܕͷߟ͑ํΛֶͿຊ Cats ʜ Scala

    ͰΰϦΰϦؔ਺ܕ͢ΔͷΛิॿ͢ΔϥΠϒϥϦ Cats ͷ࢖͍ํΛֶͿຊ
  3. ຊͷষཱͯ Monoids and Semigroups Functors Monads Monad Transformers Semigroupal and

    Applicative Foldable and Traverse Testing Asynchronous Code Map-Reduce Data Validation CRDTs ײ૝ ාͦ͏
  4. ਪ࿦աఔ ܕΫϥε F ʹରͯ͠ F[A] ͱ F[B] ͔Β F[A,B] ܕΛ࡞Γ͍ͨ

    F ͕ Cartesian ͳΒ product ͰͰ͖Δ ͳͷͰ Promise ͕ Cartesian Ͱ͋Δ͜ͱΛࣔͤ͹ OK Promise ͸ Scala Ͱ͍͏ͱ͜Ζͷ Future ͔ͩΒ Monad Ұൠʹ Monad ) Applicative ) Cartesian ͳͷͰ OK ࢒೦ͳ͓஌Βͤ ͜ͷਪ࿦͸େ͖ͳ͕݀͋Δ Javascript ͷ Promise ͸ Monad Ͱ͸ͳ͍ Functor Ͱ͢Βͳ͍ Cartesian ʹݟ͑Δͷ͸ଟ෼ۮવ