Refinement Types?

I don’t like this solution. I think throwing runtime exceptions isn’t really close enough to refinement types. Nullability is at least a compile-time solution.

I want to be able to use “nonEmptyString” and know that either when I use it, or after I unwrap it, it’s there. Not that there’s a chance that the app blows up if the user doesn’t enter a string lol

1 Like