Closed whatyouhide closed 3 years ago
+1 from me, I think another good use case is re-implementing timeout:
[
timeout: [type: {:or, [{:value, :infinity}, :non_neg_integer]}]
]
Isn't this the same as {:in, [false]}
? 🤔 Maybe keep in
and improve the error message if it has only one element?
@josevalim that is a Good Point™, didn't think about it! I won't even improve the error message for now, it's fine 😄
This type is not particularly useful per se, but will be really handy for
:or
. For example, nimble_option's:doc
can be validated as:Thoughts?