Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20250206 関数型DDD 4
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
saka
December 24, 2025
12
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20250206 関数型DDD 4
saka
December 24, 2025
More Decks by saka
See All by saka
20250304 関数型DDD 6
sakatttttta
0
25
20241219 Github Actionsの面倒いところ
sakatttttta
0
18
20250109 関数型
sakatttttta
0
11
20250116 関数型DDD 2
sakatttttta
0
11
20250123 関数型DDD 3
sakatttttta
0
11
20250213 関数型DDD 4
sakatttttta
0
12
20250220 Hono カスタムfetch
sakatttttta
0
10
20250225 関数型DDD 5
sakatttttta
0
9
20250311 関数型DDD 7
sakatttttta
0
9
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Typedesign – Prime Four
hannesfritz
42
3.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Chasing Engaging Ingredients in Design
codingconduct
0
360
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Transcript
ؔܕଓ͖
લճ
type Option<'a> = | Some of 'a | None
type Result<'Success, 'Failure> = | Ok of 'Success | Error
of 'Failure
ܕʹΑΔ υϝΠϯϞσϦϯά
ܕΛίʔυԽ
// ----- ະݕূͷঢ়ଶ ----- data UnvalidatedOrder = UnvalidatedCustomerInfo AND UnvalidatedShippingAddress
AND UnvalidatedBillingAddress AND list of UnvalidatedOrderLine
work f low "Place Order" = input: UnvalidatedOrder output (on
success): OrderAcknowledgmentSent AND OrderPlaced (to send to shipping) AND BillableOrderPlaced (to send to billing) output (on error): InvalidOrder
جຊతͳߟ͑
// ܕΛఆٛ type CustomerId = CustomerId of int type OrderId
= OrderId of int // Λఆٛ let customerId = CustomerId 42 let orderId = OrderId 42 // CustomerIdΛ͏ؔΛఆٛ let processCustomerId (id: CustomerId) = ... // OrderIdΛ͢ͱ -- ίϯύΠϥʔΤϥʔʂ processCustomerId orderId
None
None
ϫʔΫϑϩʔ
type ValidateOrder = UnvalidatedOrder -> ValidatedOrder
ग़ྗೖྗ͕ෳࡶͳ߹
ೖग़ྗ͕ෳ
type PlaceOrderEvents = { AcknowledgmentSent : AcknowledgmentSent OrderPlaced : OrderPlaced
BillableOrderPlaced : BillableOrderPlaced } type PlaceOrder = UnvalidatedOrder -> PlaceOrderEvents
ೖग़ྗ͕Ͳ͔ͬͪ
type CategorizedMail = | Quote of QuoteForm | Order of
OrderForm // etc type CategorizeInboundMail = EnvelopeContents -> CategorizedMail
ΤϥʔΛฦ͢Մೳੑ
type ValidateOrder = UnvalidatedOrder -> ValidatedOrder type ValidateOrder = (unvalidatedOrder:
UnvalidatedOrder) => ValidatedOrder;
type ValidateOrder = UnvalidatedOrder -> Result<ValidatedOrder, ValidationError list> and ValidationError
= { FieldName : string ErrorDescription : string }
͞Βʹඇಉظ
type ValidationResponse<'a> = Async<Result<'a, ValidationError list>> type ValidateOrder = UnvalidatedOrder
-> Async<Result<ValidatedOrder, ValidationError list>> type ValidateOrder = UnvalidatedOrder -> ValidationResponse<ValidatedOrder>
None