ScalaMatsuri CFPひとめぐり / ScalaMatsuri CFP quick tour

25fb3e7054e52e524817044853c2d4c3?s=47 Taisuke Oe
January 08, 2020

ScalaMatsuri CFPひとめぐり / ScalaMatsuri CFP quick tour

Presented on January 8th 2020 at Pre ScalaMatsuri meetup.

25fb3e7054e52e524817044853c2d4c3?s=128

Taisuke Oe

January 08, 2020
Tweet

Transcript

  1. 4DBMB.BUTVSJ $'1ͻͱΊ͙Γ ϓϨ4DBMB.BUTVSJ

  2. ࣗݾ঺հ w 5BJTVLF0F w 5XJUUFS!0&@VJB w 4DBMB.BUTVSJΛओ࠵͍ͯ͠·͢ɻ w εϐʔΧʔܦݧ w

    4DBMB%BZT w +$$POG w 4DBMBؔ੢αϛοτ w 4DBMB.BUTVSJͳͲ
  3. ࠓ೔఻͍͑ͨ͜ͱ w εϐʔΧʔָ͍ͬͯ͠Α w εϐʔΧʔͱͯ͠ୈҰาΛ౿Έग़͢ಓ͠Δ΂

  4. ఻͑ΒΕͳ͍͜ͱ w ❌εϐʔΧʔͱͯ͠ͷϕετϓϥΫςΟε w ❌4DBMB.BUTVSJͰԠืηογϣϯ͕࠾༻͞ΕΔํ๏

  5. ΞδΣϯμ w ͦ΋ͦ΋ɺͳͥΧϯϑΝϨϯεͰ஻Δͷ͔ʁ w εϐʔΧʔʹͳΔʹ͸ɺͲ͏͢Ε͹͍͍ͷ͔ʁ

  6. ͳͥΧϯϑΝϨϯεͰ ஻Δͷ͔ʁ

  7. ͳͥΧϯϑΝϨϯεͰ ஻Δͷ͔ʁ ࢲͷ৔߹ w εϐʔΧʔʹͳΔͷ͕ɺҰ൪ָ͘͠աͤ͝Δɻ w ษڧ͢ΔϞνϕʔγϣϯʹͳΔɻ w ࣗ෼͕ਪٕ͢ज़Λɺਖ਼͍͠࢖͍ํͱͱ΋ʹ޿ΊΒΕΔɻ w

    ࢀՃඅͷෛ୲͕ݮΔʢՄೳੑ͕ߴ͍ʣɻ
  8. w ࣗ෼Λ޿͘஌ͬͯ΋Β͏͖͔͚ͬʹͳΔɻ w ໘ന͍Πϕϯτʹ༠ͬͯ΋Β͑ͨΓɺ௕ظతʹ͸ࣗ෼ ͷ࢓ࣄʹܨ͕ͬͨΓ΋͢Δɻ w ॳର໘ͷਓ΋ɺࣗ෼ͷ޷͖ͳ࿩୊ʢొஃωλʣͰ࿩͔͠ ͚͖ͯͯ͘ΕΔ֬཰্͕͕Δɻ w ͦͷ৔ݶΓͷೱ͍ू·ΓʢεϐʔΧʔσΟφʔͳͲʣͰٞ

    ࿦Ͱ͖Δɻ ͳͥΧϯϑΝϨϯεͰ ஻Δͷ͔ʁ ࢲͷ৔߹
  9. εϐʔΧʔʹͳΔʹ͸ Ͳ͏͢Ε͹͍͍ͷʁ

  10. εϐʔΧʔʹͳΔʹ͸ Ͳ͏͢Ε͹͍͍ͷʁ w ηογϣϯެืܕͷΧϯϑΝϨϯεͰΑ͋͘ΔྲྀΕ ςʔϚΛܾΊΔ $'1ʹԠื͢Δ ౰མ݁ՌΛ஌Δ τʔΫͷ४උ͢ΔʢεϥΠυΛ࡞Δʣ ຊ൪౰೔ʹ஻Δ

  11. εϐʔΧʔʹͳΔʹ͸ Ͳ͏͢Ε͹͍͍ͷʁ w 4DBMB.BUTVSJͷྲྀΕ ςʔϚΛܾΊΔΠϚίί $'1ʹԠื͢Δʜ"OZXIFSFPO&BSUIక੾ ౰མ݁ՌΛ஌Δʜ݄த τʔΫͷ४උ͢ΔʢεϥΠυΛ࡞Δʣʜ݄ ຊ൪౰೔ʹ஻Δʜ݄೔ɾ೔

  12. ςʔϚΛܾΊΔ

  13. ࠓ೥͸͕ͧ͘͞Μ ΑΖ͓͘͠ئ͍͠·͢ʂ ࢀߟϓϨ4DBMB.BUTVSJͷͱ͖ͷࢿྉ

  14. $'1ʹԠื͢Δ

  15. $'1ʹԠื͢Δ w ͜ͷ৔߹ɺ$'1͸$BMMGPS1SPQPTBMT1SFTFOUBUJPOTͷ ུɻ w ηογϣϯͷҰൠืूͷ͜ͱɻ w $'1ʹର͢ΔԠืͷ͏ͪɺ࠾༻͞Εͨ΋ͷ͕λΠϜςʔϒ ϧ΁ׂΓ౰ͯΒΕ·͢ɻ

  16. 4DBMB.BUTVSJ$'1 w ࠓ೥ͷΧϯϑΝϨϯε͸̐τϥοΫʂ w ৄࡉ͸ͪ͜Β w IUUQTTDBMBNBUTVSJPSHKBDGQ

  17. Ԡืཁ߲ൈਮ Scala Scala 40 100 20 ) 200 300 (

    ) 3 1 Repository Pull Request
  18. Ԡืཁ߲ൈਮ Scala Scala 40 100 20 ) 200 300 (

    ) 3 1 Repository Pull Request
  19. 4DBMBϏΪφʔͷఆٛ ͜ͷΧςΰϦ͸ɺScalaͰίʔυΛॻ͖࢝Ίͨਓ͕ΑΓScalaΛ࢖͍͜ͳͯ͠ɺૉૣ͘σόοάͨ͠Γɺద੾ ͳந৅ԽΛ࢖͍͜ͳͨ͠ΓɺΫϦʔϯͰ҆શͳίʔυΛॻ͚ΔΑ͏ʹͳΔͨΊͷηογϣϯͰ͢ɻ ྫ͑ ͹ɺҎԼͷΑ͏ͳࢀՃऀΛର৅ͱͨ͠ηογϣϯ͕֘౰͠·͢ɻ • ScalaͷίϨΫγϣϯૢ࡞Λ͢Δͱ͖ʹmap, flatMap, filter, findͳͲɺجຊతͳ΋ͷҎ֎͋·Γ࢖ͬͨ

    ͜ͱ͕ͳ͍ɻ • forࣜͰॻ͚Δ΋ͷͱͦ͏Ͱͳ͍΋ͷͷ۠෼΍ɺॻ͚Δ৚͕݅Α͘෼͔Βͳ͍ɻ • OptionɺTryɺEitherͷ࢖͍෼͚͕Α͘෼͔Βͳ͍ɻ͍ͭྫ֎Λ౤͛ͯ͠·͏ɻ • case classͱclassɺabstract classɺtraitͳͲͷҧ͍͕Α͘෼͔Βͳ͍ɻ • ύλʔϯϚονΛɺmatchࣜҎ֎Ͱ࢖ͬͨ͜ͱ͕ͳ͍ɻෳ਺ͷύλʔϯΛ૊Έ߹Θͤͯ࢖͍ͬͯͳ͍ɻ • ܕύϥϝʔλʔ΍implicitͷ࢖͍ॴ͕Α͘෼͔Βͳ͍ɻͦΕΒ͕࢖ΘΕͨίʔυΛಡΊͳ͍ɻ ৽͍͠੾ΓޱͰ͜͏͍ͬͨجૅΛղઆ͢Δηογϣϯ΍ɺ࠶ೖ໳͢ΔηογϣϯͳͲɺ͞·͟·ͳ੾Γޱ ͰͷηογϣϯΛืू͠·͢ɻͥͻ͝Ԡื͍ͩ͘͞ɻ
  20. બߟํ๏ൈਮ ScalaMatsuri 2 w ͲͪΒͷબߟํ๏ʹ߹Θͤͨํ͕௨Γ΍͍͢ɺ౳͸ʢࠓ ೥͸ಛʹʣͳ͍Ͱ͢ɻ w ԦಓͰ΋มԽٿͰ΋ɺۀ຿ؔ࿈Ͱ΋झຯܥͰ΋׻ܴͰ͢ɻ

  21. 4DBMB.BUTVSJ$'1 w కΊ੾Γ͸"OZXIFSFPO&BSUI w +45

  22. 4DBMB.BUTVSJ౰མ w ηογϣϯืूͷకΊ੾Γ͔Βɺि͔ؒΒϲ݄͙Β͍Ͱૹ෇ ͞Ε·͢ɻ4DBMB.BUTVSJͰ͸ɺ݄຤ࠒʙ݄ॳ०Λ༧ఆ͍ͯ͠ ·͢ɻ w Α͋͘ΔޡղΑ͋͘Δޡղʮ࠾༻͞Εͳ͍࣭͕௿͍ʯͰ͸͋ Γ·ͤΜɻૉ੖Β͍͠ηογϣϯͰ΋ɺௌऺͷ૚ʹ͋Θͳ͔ͬ ͨΓɺΧςΰϦͷภΓʹΑͬͯ͸࠾༻͞Εͳ͔ͬͨΓ͠·͢ɻ ؾΛམͱ͞ͳ͍Ͱ͍ͩ͘͞ɻ

    w 4DBMB.BUTVSJͰ͸ʹΞϯΧϯϑΝϨϯεΛ։࠵͠·͢ɻ ౰೔ʹొஃ࿮͕ܾఆ͞Ε·͢͠ɺ਺΋ଟ͍ͷͰɺͥͻͦͪΒ΋ νϟϨϯδͯ͠Έ͍ͯͩ͘͞ɻ
  23. εϥΠυ࡞੒ w εϥΠυ࡞੒͠͸͡ΊΔલʹɺ࿦ࢫΛ໌֬ʹ͠·͠ΐ͏ʂ w ʮҰ൪఻͍͑ͨϝοηʔδʯͬͯͳΜͩΖʁࣗ෼ͷϝο ηʔδΛཧղͯ͠΋Β͏ʹ͸ɺͲΜͳ஌ࣝ΍ࠜڌ͕ඞཁ ͩΖ͏ʁͲ͏ͯ͠΋఻͓͖͍͑ͯͨࣄ࣮ͬͯɺͳΜͩΖ ͏ʁ

  24. ٕज़తݕূ w ٕज़తͳهड़ʹؒҧ͍͕ͳ͍͔ɺࣗ෼Ͱݕূ͢ΔบΛͭ ͚·͠ΐ͏ɻ w ݴ༿ͷఆ͕ٛਖ਼͔֬ओޠ͕ద੾ͳେ͖͔͞ w அݴ͍ͯ͠Δ΋ͷʹ͍ͭͯɺྫ֎͸ଘࡏ͠ͳ͍ͷ͔

  25. ٕज़తݕূ w ίʔυΛॻ͍ͯಈ͔ͯ͠ݕূͯ͠ΈΔ w ΦϑΟγϟϧͷυΩϡϝϯτ΍ʢධ൑ͷྑ͍ʣॻ੶ͳͲ ͱɺໃ६͕ͳ͍͔ௐ΂Δ w ʢ044ͳΒ͹ʣ֘౰͢ΔιʔείʔυΛಡΉ w ͦͷ্Ͱɺಉ྅ͳͲʹϨϏϡʔΛґཔ͢Δͷ͸ྑ͍ϓϥ

    ΫςΟεͰ͢ʂ
  26. ࿅श w εϥΠυΛΑΓྑ͘͢ΔͨΊͷ࿅श w εϥΠυ͕Ұ௨ΓͰ͖ͨΒɺ·ͣ͸εϥΠυͷϒϥο γϡΞοϓͷͨΊʹܰ͘࿅शͯ͠Έ·͠ΐ͏ɻ w ͻͱΓͰ࿅श w ·ͣ͸ҰਓͰ௨ͯ͠஻ͬͯΈΔͷ͕ΦεεϝͰ͢ɻ୯७

    ʹ࿩׳ΕΔ͚ͩͰͳ͘ɺ࿩ͷےಓͷෆࣗવ͞΍ɺ৑௕ͳ ෦෼ͳͲʹؾ͖ͮ·͢ɻ
  27. ࿅श w εϥΠυͷϒϥογϡΞοϓ͕ਐΜͰ͖ͨΒɺࣾ಺ൃදձ ΍ɺษڧձͳͲͷ࿅श৔ॴΛͭ͘Γ·͠ΐ͏ɻ w ϑΟʔυόοΫΛੵۃతʹ΋Β͏ͱɺ࿦ࢫͷෆ໌ྎͳ఺ ΍ɺٕज़తͳؒҧ͍ͳͲʹؾ͖ͮ΍͍͢Ͱ͢ɻ

  28. εϥΠυఏग़ w ΧϯϑΝϨϯεʹΑͬͯ͸ඞཁͰ͢ɻ w 4DBMB.BUTVSJͰ͸ɺӳޠɾࣈນ΍$P$ͷ֬ೝͷͨΊɺ ݄ͷఏग़Λ͓ئ͍͍ͯ͠·͢ɻ w ͦͷޙ΋ඍमਖ਼͸ՄೳͰ͢ɻͦͷ৔߹͸ɺ׬੒εϥΠυΛ ࠶౓ૹ෇͍ͯͩ͘͠͞ɻ

  29. ຊ൪લͷ࿅श w ൃදʹ׳ΕΔͨΊʹɺ࿅श͍͖ͯ͠·͠ΐ͏ɻ࠷ॳͷ͏ͪ ͸ɺࣗ෼ͷ࿩͍ͯ͠Δ༷ࢠΛಈըͰࡱͬͯݟฦ͢ͱɺ͍Ζ͍ Ζͳؾ෇͖͕͋Γ·͢ɻ w ࿅श͢Ε͹͢Δ΄Ͳɺྲྀெʹ஻ΕΔΑ͏ʹͳΓ·͢ɻྲྀெʹ ஻ΕΔͱɺࣗ৴͕ੜ·Ε·͢ʂʢٯʹ๩ͯ͘͠࿅श͕ෆे෼ ͩͱɺ౰೔͏·͘஻Εͣʹɺ༨ܭʹযͬͨΓ͠·͢ʜʣ w

    ࣭໰͞Εͦ͏ͳ͜ͱʹ͍ͭͯɺௐ΂͓͖ͯ·͠ΐ͏ɻΈΜͳ ͷલͰ࿅श͢ΔͱɺԿʹಥͬࠐ·ΕΔ͔ɺΑ͘Θ͔Γ·͢ɻ
  30. ຊ൪ w εϥΠυΛ࡞ΓࠐΜͰɺ࿅श΋े෼͓͚ͯ͠͹ɺ͋ͱ͸ຊ ൪Ͱ஻Δ͚ͩͰ͢ɻલ೔͸͙ͬ͢Γ৸ͯɺΧϯϑΝϨϯ ε౰೔͸ָ͠Ή͜ͱʹूத͠·͠ΐ͏ʂ w εϐʔΧʔʹͳΔͷͬͯɺ༐ؾ͕͍Δ͜ͱͰ͢ΑͶɻΈ ͳ͞Μɺ·ͣ͸ୈҰาΛ౿Έग़͞Εͨ͜ͱ͕ɺૉ੖Β͠ ͍ͱࢥ͍·͢ɻ w

    εϐʔΧʔʹͳΔ͜ͱͰɺΑΓָ͍࣌ؒ͠Λաͤͨ͝Γɺ ྑ͖ग़ձ͍͕͋Δ͜ͱΛف͍ͬͯ·͢ʂ