Impressive!
By the way, one of the most common mistakes is to forget that a function application binds tighter than
infix operators, e.g.,
Although your branch already provides a nice error message:
Error: The function `+' cannot be applied to the arguments provided.
| Types of the expected arguments: | Types of the provided arguments:
---|-------------------------------------|------------------------------------
that is probably better than the default:
Error: This expression has type unit but an expression was expected of type
it is still probably a good idea, to provide an ad-hoc error message here (as you did for missing `()`, `!` and `rec`).
In this case, if an offending expression contains a binary operator which has an application to the left and some simpl_expr
on the right, and if we can fix it by parenthesizing the expression, then we can suggest adding parentheses around the expression.
Regards,
Ivan Gotovchits