[m-rev.] for review: method_infos

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Nov 22 02:39:46 AEDT 2022


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?
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 followed your other suggestions. Thanks for the review.

Zoltan.


More information about the reviews mailing list