Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lkitching
on Nov 8, 2019
|
parent
|
context
|
favorite
| on:
Parse, Don’t Validate
This isn't about encoding the validation rules in the type system, only the requirement that validation with respect to some properties has been done. So in your example you would just define a function
createPurchaseRequest :: UserRequest -> Purchase -> Maybe PurchaseRequest
now everywhere in the code taking a PurchaseRequest can assume it is valid.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: