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
840
3ヶ月間Scalaと付き 合って感じた事 ……という発表を想定していたのですが
cedretaber
3
3k
Other Decks in Programming
See All in Programming
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
180
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
470
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Refactor your code - refactor yourself
xosofox
1
260
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
たのしいparse.y
ydah
3
120
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
280
testcontainers のススメ
sgash708
1
120
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Optimizing for Happiness
mojombo
376
70k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
GitHub's CSS Performance
jonrohan
1030
460k
Typedesign – Prime Four
hannesfritz
40
2.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Agile that works and the tools we love
rasmusluckow
328
21k
Site-Speed That Sticks
csswizardry
2
190
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
The World Runs on Bad Software
bkeepers
PRO
65
11k
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