unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.78k stars 270 forks source link

revisit/cleanup how numbered args are generated and used #4606

Open aryairani opened 9 months ago

aryairani commented 9 months ago

We have Output (the original) and NumberedOutput (meant for numbered args, but especially for generating and numbering output at the same time), and evidently (as seen in #4601, #4603) started to diverge in how we create numbered args.

I remember finding respondNumbered awkward to use in some cases, and using respond + manually setting numbered args is more flexible (though also more error prone)

Let's discuss whether we want to continue to have two kinds of output, two ways of setting numbered args, or whether there's something we can do to consolidate and facilitate their use.

aryairani commented 5 months ago

Restated: Review the current respondNumbered design, and decide if it's worth it to make it better? And/or make a plan to convert to whatever consistent thing.

sellout commented 4 months ago

I think NumberedOutput is the right direction, but could go farther with sharing logic between the pretty output and the numbered args.

Here are some thoughts: