Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
猫とたはむれる
Search
cedretaber
May 15, 2017
Programming
2
850
猫とたはむれる
ScalaのFP用ライブラリ cats の紹介です。
cedretaber
May 15, 2017
Tweet
Share
More Decks by cedretaber
See All by cedretaber
関数型初心者におすすめしたい "OCaml"
cedretaber
1
810
3ヶ月間Scalaと付き 合って感じた事 ……という発表を想定していたのですが
cedretaber
3
3k
Other Decks in Programming
See All in Programming
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
Nuxtベースの「WXT」でChrome拡張を作成する | Vue Fes 2024 ランチセッション
moshi1121
1
540
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
110
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.4k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
490
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
360
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
240
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
24
11k
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
9
4.2k
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
1k
Featured
See All Featured
Side Projects
sachag
452
42k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
The Cult of Friendly URLs
andyhume
78
6k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Rails Girls Zürich Keynote
gr2m
93
13k
Transcript
ೣͱͨΉΕΔ @cedretaber
Twitter / Github @cedretaber ͓ࣄ Scala TypeScript झຯ Ruby Erlang
/ Elixir F# Dݴޠ
cats ࠓճ͝հ͢Δͷtypelevel / cats 4DBMBͰ'1Λߦ͏ҝͷϥΠϒϥϦ 4DBMB[ͱ͔ͷϑϨϯζ
Why cats? ͍͍͢σʔλܕ͕ ἧ͍ͬͯΔ 4DBMBඪ४ͷσʔλܕʹ ศརͳؔΛೖ͠ ͯ͘ΕΔ ιʔε͕ಡΈ͘͢ݟ ָ͍͍ͯͯ͠
NonEmptyList
ʮઈରʹۭ͡Όͳ͍ࣄ͕อূ͞ΕͨʯϦετɻ ʮ͜͜Ͱͬͯ͘ΔϦετۭ͡Όͳ͍ʯͬͯ࣌ʹ ͏ɻ
None
Ϧετͱͷ૬ޓม /PO&NQUZ-JTUΛ͍͍ͨ໘-JTUΛ͍͍ͨ ໘ʹแؚ͞Ε͍ͯΔͣͳͷͰɺϦετͱͷ૬ޓม ଟ༻͢Δɻ
None
ͦͷଞͷϝιου /PO&NQUZ-JTUී௨ͷϦετͷϝιου͕֓Ͷ࣮ ͞Ε͍ͯΔɻ ·ͨɺ4FNJHSPVQ,ɺ5SBWFSTFɺ.POBEͳͲͷΠ ϯελϯεͳͷͰɺศརͳϝιουଟ͑͘Δ ʢۭͷঢ়ଶ͕ଘࡏ͠ͳ͍ͨΊɺϞϊΠυͰͳ͘ ܈ͳͷͰҙɻʣ
None
None
None
ه NonEmptyVector NonEmptyStream ͋Δɻ
Validated
ʮ-FGUΛੵ͢Δ&JUIFSʯ ໊લͷ௨ΓɺόϦσʔγϣϯΛ͔͚Δ࣌ʹॏๅ͢ Δɻ
ྫ ϢʔβొͷॲཧΛߟ͑Δɻ Ϣʔβ*%ॏෳෆՄɺύεϫʔυจࣈҎ্ɺΈ ͍ͨͳͷ͕݅͋Δͱ͢Δɻ
None
͜ͷ࣮ͩͱɺ*%ͱύεϫʔυͷ྆ํʹ͕͋Δ ߹*%ͷΤϥʔ͔͠ฦΒͳ͍ɻ όϦσʔγϣϯΛߦ͏߹ɺೖྗʹଘࡏ͢Δશͯͷ ϛεΛฦ͢ํ͕Ϣʔβʹ༏͍͠ɻ ͳͷͰɺ7BMJEBUFEΛ͏ɻ
None
None
/PO&NQUZ-JTUͱͷซ༻ ઌड़ͷྫͩͱ4USJOHΛͬͯΤϥʔΛੵ͕ͨ͠ɺ จࣈྻΛͪ͝Όͪ͝Όͱଓͯ͠͠·͏ͷ͋·Γ ៉ྷͳΓํͱݴ͑ͳ͍ɻ ͳͷͰɺ/PO&NQUZ-JTUΛͬͯੵͯ͠ΈΔɻ
Ͳ͏ͯ͠/PO&NQUZ-JTUͳͷ͔ʁ ผʹ௨ৗͷ-JTUͰྑ͍ͷ͕ͩɺ7BMJEBUFEͷ߹ɺ *OWBMJEʹͳΔ࣌ԿΒ͔ͷ͕ೖ͍ͬͯΔͣͳͷ Ͱɺ*OWBMJE͔ͭத͕ۭͱ͍͏ࣄ͋Γ͑ͳ͍ɻ ͳͷͰɺ/PO&NQUZ-JTUͷํ͕૬Ԡ͍͠ɻ
None
7BMJEBUFE /PO&NQUZ-JTUͷΈ߹Θͤඇৗʹ Α͘͏ͷͰɺDBUTʹ*OWBMJEΛ/PO&NQUZ-JTU ͱఆͨ͠7BMJEBUFE/FMͱ͍͏ܕ͕༧Ί༻ҙ͞Ε ͍ͯΔɻ ˣఆٛ
None
ه ʮਖ਼͍͠Λฦͭͭ͠ɺ ్தܦաͷԿ͔ੵ ͍ͨ͠ʯͱ͍͏߹ Iorͱ͍͏σʔλܕ͕ ͑Δɻ
List, Either
҉ͷมΛར༻ͯ͠ɺDBUTطଘͷΫϥεʹ৭ʑ ͳϝιουΛੜͯ͘͠ΕΔɻ ಛʹɺ-JTU&JUIFSͷ֦ு͕ศརɻ 5SBWFSTF'PMEBCMFͲ͜·Ͱศརɻ YҎલͳΒ&JUIFSʹNBQqBU.BQΛੜͯ͠ ͘ΕΔͷศརɻ
None
None
None
None
None
None
6OBQQMZʹ͍ͭͯ ্Ͱ&JUIFS7BMJEBUFEͷ-JTUʹTFRVFODF USBWFSTFΛద༻͍ͯ͠ΔͷΛݟͯɺٙʹײͨ͡ํ ଟ͍ͩΖ͏ɻ ͱ͍͏ͷɺ෦ద༻͞ΕͨܕҾΛਪͰ͖ͳ͍ ͱ͍͏ʢ4*ʣ༗໊ͰɺͦΕʹରԠ͢Δ ͨΊʹDBUT6OBQQMZΛ͍͔ͬͯͨΒͩɻ
None
͔͜͠͠ͷఔલʹղܾ͞Ε͓ͯΓɺ 4DBMB͔Βܕਪ͕վળ͞Ε͍ͯΔɻ ·ͨچόʔδϣϯͷ4DBMBͰɺTCUͷϓϥάΠϯΛ ͏ࣄͰಉͷػೳΛར༻Ͱ͖Δɻ ͜ΕΛड͚ͯDBUTͰɺٞͷɺ6OBQQMZͷར ༻Λίʔυ͔Βഉআ͢Δࣄʹͨ͠Β͍͠ɻ
ऴΘΓʹ
DBUTTDBMB[ʹ༻ҙ͞ΕͨศརͳؔΛ͏ͱɺ ͍͜͠ॲཧΛεοΩϦͱॻ͘ࣄ͕Ͱ͖Δɻ ಛʹUSBWFSTFTFRVFODFͳͲɺ࠶ؼؔ GPME-FGUΛۦͯ͠ॻ͜͏ͱ͢ΔͱͲ͏ͯ͠ෳࡶ ʹͳͬͯ͠·͏ɻ
ͨͩ͠ɺແҋʹ͍͍͑ͱ͍͏Θ͚Ͱͳ͍ͷͰ ҙɻ ݟ׳Εͳ͍ϝιουΛ͏ΑΓɺ࠶ؼؔͱ GPME-FGUͰॻ͍ͨํ͕ʢिؒޙͷࣗΛؚΊͨʣ ଞਓʹͱͬͯಡΈ͍͢ࣄ͋Δɻ ͦͷ͋ͨΓνʔϜͷͳͲݟͭͭௐ͍͖ͯ͠ ·͠ΐ͏ɻ
ࢀߟࢿྉ w UZQFMFWFMDBUT IUUQTHJUIVCDPNUZQFMFWFMDBUT w ೣ൪ IUUQFFETJODPNIFSEJOHDBUT