Macaulay2 / Macaulay2/M2

A type-valued argument is described as a value in a doc node's Inputs, contradicting the same node's heading

Open
#4,610 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bugs directory Documentation
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

This issue was triaged from [`bugs/dan/3-inheritance-on-classes-of-output-parameters`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/3-inheritance-on-classes-of-output-parameters), one of the 857 files removed from the pre-GitHub `bugs/` tree by [`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). **The commentary below was written by Claude (Claude Opus 5, via Claude Code)**, not by @d-torrance, whose account posted it -- please weigh it accordingly.

### The original file, verbatim

```text
documentation has to be fixed eventually, if it is to be automatic:

instead of

* ZZ, an integer

say

* ZZ, a type of integer

??

=============================================================================

i1 : document { Key => (lift', QQ, ZZ), Usage => "lift'(r,ZZ)", Inputs => { "r", "ZZ" } }

i2 : help (lift', QQ, ZZ)
--warning: this node needs rewriting : method(Dispatch => ...)

o2 = lift'(QQ,ZZ)
************

Synopsis
========

* Usage: lift'(r,ZZ)
* Function: "lift'"
* Inputs:
* r, a rational number
==> * ZZ, an integer

Description
===========

o2 : DIV

i3 : methodOptions lift'

o3 = OptionTable{Associative => false }
Dispatch => {Thing, Type, Type}
Options =>
SingleArgumentDispatch => false
TypicalValue => Thing

o3 : OptionTable
```

### Where it stands today

When a method dispatches on a *type* argument, its documentation page describes that argument two
ways, and only the heading is right.

```m2
i1 : zzlift = method(Dispatch => {Thing, Type});

i2 : zzlift(QQ, ZZ) := (r, T) -> 1;

i3 : document { Key => (zzlift, QQ, ZZ), Usage => "zzlift(r,ZZ)",
Inputs => { "r", "ZZ" }, Outputs => {{"one"}} };

i4 : help (zzlift, QQ, ZZ)

o4 = zzlift(QQ,type of ZZ)
*********************

* Function: "zzlift"
* Usage:
zzlift(r,ZZ)
* Inputs:
* r, a "rational number"
* ZZ, an "integer"
* Outputs:
* one
```

The heading says `type of ZZ`. Three lines below, the same argument is `an "integer"`. The second
argument is not an integer — it is the type `ZZ` itself, which is what `Dispatch => {Thing, Type}`
declares and what the heading already reflects. The wording wanted is "a type of integer".

The information is evidently available where the heading is built, so this is the Inputs renderer
not asking for it rather than the machinery not knowing.

### What has already been fixed

Two thirds of the original report are gone. The bug file below records the same node also emitting

```
--warning: this node needs rewriting : method(Dispatch => ...)
```

which matches nothing in the tree today, and rendering the key flat as `lift'(QQ,ZZ)` with no sign
that the second position is a type. Only the Inputs line is left.

`open` · disposition `issue` · source of truth: [`bug-triage/catalog.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/catalog.tsv)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the documented `zzlift` example and compare the heading with its Inputs output. Trace the Inputs renderer and the existing heading logic that recognizes `Dispatch = > {Thing, Type}`. Done means a type-valued argument is described as “a type of integer” rather than “an integer,” without regressing the heading.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.