Closed brettcannon closed 6 months ago
My best guess is that some past version of me lived in a universe where things always failed in the exact same way?
@dusty-phillips would you want a PR that requires a check function, or makes it optional?
Yup! I’ll try to pop a release out after, too.
@dusty-phillips was that a "yup" to option 1, option 2, or dealer's choice? And if it's option 2, would you want option*
and requireOk
to be updated accordingly? And if it's option 1 do you want some no-op function or some other solution that provides a message (and updating the other related functions accordingly)?
Sorry! I think it should be optional and make the others consistent, but I could go either way.
https://github.com/dusty-phillips/rescript-zora/blob/19c5c7c39f276e68b63c9ffd398f931b43e9b4fc/src/Zora.res#L41
Compare that to
requireOk
: https://github.com/dusty-phillips/rescript-zora/blob/19c5c7c39f276e68b63c9ffd398f931b43e9b4fc/src/Zora.res#L47Since
Error
can have a value, would it make sense forrequireError
to also take acheck
function (and thus drop the~msg
parameter)?