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
20250512 関数型DDD 10
Search
saka
December 24, 2025
2
0
Share
20250512 関数型DDD 10
saka
December 24, 2025
More Decks by saka
See All by saka
20250304 関数型DDD 6
sakatttttta
0
17
20241219 Github Actionsの面倒いところ
sakatttttta
0
3
20250109 関数型
sakatttttta
0
3
20250116 関数型DDD 2
sakatttttta
0
4
20250123 関数型DDD 3
sakatttttta
0
2
20250206 関数型DDD 4
sakatttttta
0
1
20250213 関数型DDD 4
sakatttttta
0
2
20250220 Hono カスタムfetch
sakatttttta
0
1
20250225 関数型DDD 5
sakatttttta
0
1
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
250
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
490
KATA
mclloyd
PRO
35
15k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
260
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
210
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
First, design no harm
axbom
PRO
2
1.2k
How to Ace a Technical Interview
jacobian
281
24k
Chasing Engaging Ingredients in Design
codingconduct
0
160
Automating Front-end Workflow
addyosmani
1370
200k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
110
Being A Developer After 40
akosma
91
590k
Transcript
ؔܕDDD
Τϥʔ
ࠓ·ͰΤϥʔͳ͠ ߟ͍͑͢Α͏ʹ
Resultܕ
໌͍ࣔͨ͠
Τϥʔ
type CheckAddressExists = UnvalidatedAddress -> CheckedAddress
શҬؔʹ͍ͨ͠…
type CheckAddressExists = UnvalidatedAddress -> Result<CheckedAddress, AddressValidationError> and AddressValidationError =
| InvalidFormat of string | AddressNotFound of string
ΤϥʔΛྨ
υϝΠϯΤϥʔ ϏδωεϓϩηεͷҰ෦ͱ͠ ͯ༧͞ΕΔΤϥʔ ྫɿແޮͳίʔυ
ύχοΫ ॲཧෆՄೳͳγεςϜΤϥʔ ϓϩάϥϚͷݟམͱ͠ʹΑΔ Τϥʔ ྫɿϝϞϦෆ
ΠϯϑϥετϥΫ νϟΤϥʔ ωοτϫʔΫλΠϜΞτɺೝ ূࣦഊͳͲ
ҟͳΔ࣮͕ඞཁ
υϝΠϯΤϥʔ υϝΠϯϞσϦϯάʹΈࠐ ΈɺܕγεςϜʹจॻԽ
ύχοΫ ྫ֎Λൃੜͤ͞ɺ࠷্ҐͰิ
ΠϯϑϥετϥΫ νϟΤϥʔ ΞʔΩςΫνϟʹΑΔ େମυϝΠϯΤϥʔʹؚΊΔ ํཱ͕ͭ ↓ ͲΜͳΤϥʔ͕ى͜Δ͔ߟ͑Δ
Τϥʔͷܕ
type PlaceOrderError = | ValidationError of string | ProductOutOfStock of
ProductCode | RemoteServiceError of RemoteServiceError
બܕ
։ൃͷਐΊͳ͕ΒΤϥʔ έʔεΛՃ
Τϥʔॲཧ
ྫ֎ɿޭύεͷίʔυ ៉ྷ
try-catchͳͲͰࡶ
Resultʁ
ύΠϓϥΠϯ
ޭࣦഊͷ2ͭ
ͦΕΛઢ࿏Έ͍ͨʹܨ͛ Δ
2τϥοΫϞσϧ మಓࢤϓϩάϥϛϯά
ී௨ೖྗ͕Ұͭ
2ͭͷೖྗΛ࣋ͨͤΔ
Ξμϓλʔ