-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capturing true/false #11
Comments
What sort of exception would the boolean turn into? A few people have asked for automatic conversion in different forms, but there's always information loss versus using a case statement. I think that automation would be amazing if we can do it while preserving context & semantics. I'd love to hear your thoughts! |
Could take that as an argument as well perhaps, maybe defaulting to one of the generic Elixir exceptions? |
This is solved by #18 basically, just without the piping part. ^.^ Close-worthy now or leave open for more thoughts? |
It would be quite convenient to be able to wrap up true/false into something that returns an exception if on false (maybe if on true via configurable option) or else passes the input value unaltered. An example:
Although with macro work could clean it up (and could clean up others, like
safe
as well).Basically just return an ErlangError (preferably saying what failed, by saying the passed in 'should_search?/1' failed its test), else it returns the prior passed in value.
The text was updated successfully, but these errors were encountered: