You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to allow x => x < 0 and x => x > 0 as trivial functions, with other comparison operators too. These cannot ever throw and don't really need fancy names or parameters.
The boolean operators && and || should be allowed too IMHO.
Note that this does not include all arithmetic expressions, as for example x / y could still throw.
The text was updated successfully, but these errors were encountered:
These feel very "not trivial" to me, not in the complexity sense but in the readability sense, especially the comparison operators like >, >=, <, and <=, given how visually similar those are to the => arrow designator.
Added a comment under #28 that mostly covers this, but I think it'd be fair to include these in the trivial category because I don't think it's reasonable to have to apply a name or more-complicated parameter name to functions that are just doing comparisons.
I replied in the other thread to explain my thinking around "trivial". The more I think about it the more x => x <= y is absolutely not "trivial" IMO, for the reasons stated there.
It would be nice to allow
x => x < 0
andx => x > 0
as trivial functions, with other comparison operators too. These cannot ever throw and don't really need fancy names or parameters.The boolean operators
&&
and||
should be allowed too IMHO.Note that this does not include all arithmetic expressions, as for example
x / y
could still throw.The text was updated successfully, but these errors were encountered: