[m-rev.] for review: method_infos
Julien Fischer
jfischer at opturion.com
Tue Nov 22 11:03:33 AEDT 2022
On Tue, 22 Nov 2022, Zoltan Somogyi wrote:
>
> 2022-11-21 16:36 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
>
>>> Replace both with
>>>
>>> In instance declaration for class(foo, bar):
>>
>> That's fine for type classes with *small* numbers of arguments; it's going be
>> (arguably) less readable than just class/arity for those with larger numbers of
>> arguments; for example, the following:
>>
>> :- instance fd_solver(fdsolver, fd_bool_solver, fd_int_solver, fd_set_solver,
>> fdbool, fdvar, fdset).
>
> Yes, you are right; for long type vectors, we should just print the arity.
> The question is: what is the longest type vector that we should print out?
In practice it's also going to depend on the length of the names
involved.
> Ideally, it should be "the longest vector that fits on one line", but the code
> constructing the error message does not know what fits, and it would be
> hard to give it access to that info. So we need a heuristic. It seems that we
> both agree that class(foo, bar) is fine, and class(foo_bar, baz, quux) is not fine,
> so the only question is: is class(foo, bar, baz) fine? I have no strong opinion
> on that, so I will update the code with whatever limit you pick.
I think the threshold should be at greater than 5 arguments.
Julien.
More information about the reviews
mailing list