Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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: