Conversation
| [options, type_vars, constraints, freshen_tvars, type_errors, | ||
| defined_contracts, warnings, function_calls, all_functions]. | ||
| defined_contracts, warnings, function_calls, all_functions, | ||
| ord_constraint_types]. |
There was a problem hiding this comment.
There is no such table as I didn't find a use for it, if all ids are comparable by equality, what should go in that table?
There was a problem hiding this comment.
I don't get why there is a need for a table for ord but not for eq. Would you explain why one is needed and the other is not?
There was a problem hiding this comment.
Since all types of the form {id, _, Id} are compared by eq, there is no need to store all of them in a table, but not all types of the above form are compared by ord so I only need to store that.
So checking if {id, _, "int"} is comparable by ord will only succeed because "int" is in the table ord_constraint_types, but checking if any other type of the form {id, _, Id} is comparable by eq will always succeed.
There was a problem hiding this comment.
Check this commit that made address comparable by ord fc28759.
| @@ -0,0 +1,169 @@ | |||
| contract A = entrypoint init() = () | |||
|
|
|||
| main contract C = | |||
There was a problem hiding this comment.
Please write tests for type inference:
function f(x) = x == x // PASS
function g() = f(g) // FAIL
| [] => abort("drop_last_unsafe: list empty") | ||
|
|
||
|
|
||
| function contains(e : 'a, l : list('a)) = switch(l) |
There was a problem hiding this comment.
Please add versions of insert_by and sort (and possibly others) that instead of taking a comparison lambda, rely on the constraints
There was a problem hiding this comment.
Remember that you actually can reuse the existing definitions by just applying them with a lambda
radrow
left a comment
There was a problem hiding this comment.
Update fold in aeso_syntax_utils
Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>
Fixes: #229