Hacker News new | ask | show | jobs
by j16sdiz 1967 days ago
It is a uid (as in user id), not uuid. Don’t think you can use sum type for that
1 comments

It is a user id, but that bug happened because a -1 was being returned as an error code in one place, and then being accidentally passed in another place. The sum type would be used as the “this possibly errors” return type in the first function, making the bug effectively impossible to happen by accident.