[Feature] Convert Bool functions to Failable counterparts
Is your feature request related to a problem? Please describe.
The use of Bool should always indicate existence of certain attribute. A case for that would be checking if something is switched on or off. Another example would be to get information if certain value exists somewhere. In case of returning a success status, we should always return failure which gives more information about the error (different errors may have different exit codes). This is something that we're not consistent with in the Amber's standard library.
// Example of using boolean to return a status
let success = foo()
if !success {
echo "Something went wrong :("
}
// Example of failing a function to return a status
let success = foo() failed {
echo "Failed with exit code: {status}"
}
Describe the solution you'd like
Convert all functions that return Bool value as a status to a failable function equivalent.
Describe alternatives you've considered N / A
Additional context Standard Library
I agree. The strategy returning false looks like the old PHP code. Nowadays even PHP doesn't do that.