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
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
The agentic SEO stack - context over prompts
schlessera
0
970
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
760
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
Automating Front-end Workflow
addyosmani
1369
210k
エンジニアに許された特別な時間の終わり
watany
109
250k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
KATA
mclloyd
PRO
35
16k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
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