Skip to content

Conversation

@wojpok
Copy link

@wojpok wojpok commented May 24, 2025

No description provided.

Copy link

@KR338 KR338 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further spell check/proofread

Copy link

@Brychlikov Brychlikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some grammar mistakes.

@wojpok wojpok requested review from Brychlikov and KR338 December 11, 2025 09:38
@wojpok wojpok marked this pull request as ready for review December 11, 2025 09:39
Copy link
Member

@ppolesiuk ppolesiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and I agree with proposed guidelines. I have some minor comments on what could be improved.


The `@param` label is followed by a parameter name and may include an optional
description. Optional and implicit parameters must be prefixed with `~` or `?`,
just as in code. Unnamed parameters cannot be documented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does unnamed mean positional here? We code be more precise.

Suggested change
just as in code. Unnamed parameters cannot be documented.
just as in code. Unnamed (positional) parameters cannot be documented.

Copy link
Author

@wojpok wojpok Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It refers to arguments in point-free style. For example function let ignore x = id cannot be fully documented, because second argument comes from identity function. I will rephrase this part a little bit

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also wildcards may disqualify @param label. Function let ignore _ = id literally can't use @param label despite having 2 arguments

- `@parameter Name`
- `@method Type Name`
- `@val Name` - refers to any let statement
- `@handler Name`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a separate @handler opening marker? As effect capabilities are first class, we can use @val.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really recall logic behind this. I think you are right, it can be deleted

Comment on lines +79 to +80
- `@data Name` - ADTs and records
- `@type Name`- Builtin types and type synonyms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to distinguish between them. The use the same namespace, so @type is sufficient.

Supported identifiers include:
- `@data Name` - ADTs and records
- `@type Name`- Builtin types and type synonyms
- `@parameter Name`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it for parameter declarations? The documentation should be more specific.

- `@val Name` - refers to any let statement
- `@handler Name`
- `@module Module`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to see an example here.

Comment on lines +11 to +12
or multi-line. They always begin with a double `##` symbol and must start in
the first column of an empty line.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contradicts with what is said for constructor documentation. I think, the ## should be indented to the same column as the documented entity.

Moreover, it should be clear that a docstring starts with ## or {## (from what is said, it is not clear how to start multiline docstring).

@ppolesiuk ppolesiuk requested review from Copilot and removed request for KR338 December 14, 2025 19:53
@ppolesiuk ppolesiuk requested a review from KR338 December 14, 2025 19:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces comprehensive documentation guidelines for the standard library, establishing a "code-first" approach where documentation is embedded directly in code through docstrings and then extracted by specialized tooling.

Key Changes

  • Adds detailed documentation format specifications including single-line and multi-line docstring syntax with ## markers
  • Defines documentation guidelines for various code elements (functions, methods, ADTs, records, types) with support for @param, @asserts, and @returns labels
  • Provides concrete examples demonstrating documentation best practices for builtin types (Int64) and complex functions (foldRighti1)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
src/conv/documentation.md New documentation guidelines file covering format specifications, scoping mechanisms, ADT/record documentation, style guidelines, and practical examples
src/SUMMARY.md Adds entry for the new Code Documentation section to the table of contents

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

closing marker of a multiline comment can appear either on a separate line or
immediately after the final line of the docstring body.

During the process of generating doc pages, all docstring are concatenated
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "docstring" should be plural "docstrings" to match the subject-verb agreement with "are".

Suggested change
During the process of generating doc pages, all docstring are concatenated
During the process of generating doc pages, all docstrings are concatenated

Copilot uses AI. Check for mistakes.
Specifically, don't write descriptions like "`map` maps ..." and
"`append` appends ...".
- When optional parameters are involved, describe default behavoiur
explicitely.
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "explicitely" should be "explicitly".

Suggested change
explicitely.
explicitly.

Copilot uses AI. Check for mistakes.

When in doubt, feel free to lookup examples of other languages' documentation.

*Remeber, do not plagiariase!*
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "Remeber" should be "Remember".

Suggested change
*Remeber, do not plagiariase!*
*Remember, do not plagiariase!*

Copilot uses AI. Check for mistakes.

When in doubt, feel free to lookup examples of other languages' documentation.

*Remeber, do not plagiariase!*
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "plagiariase" should be "plagiarize" (or "plagiarise" in British English).

Suggested change
*Remeber, do not plagiariase!*
*Remember, do not plagiarize!*

Copilot uses AI. Check for mistakes.
be written separately and explicitly linked to the intended code element using
an identifier.

In such cases, docstrings are mandatorily multiline and apropriate identifiers
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "apropriate" should be "appropriate".

Suggested change
In such cases, docstrings are mandatorily multiline and apropriate identifiers
In such cases, docstrings are mandatorily multiline and appropriate identifiers

Copilot uses AI. Check for mistakes.

Supported identifiers include:
- `@data Name` - ADTs and records
- `@type Name`- Builtin types and type synonyms
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after the hyphen. Should be "- @type Name - " for consistency with other list items.

Suggested change
- `@type Name`- Builtin types and type synonyms
- `@type Name` - Builtin types and type synonyms

Copilot uses AI. Check for mistakes.
- Avoid using the function name as a noun and a verb in the same sentence.
Specifically, don't write descriptions like "`map` maps ..." and
"`append` appends ...".
- When optional parameters are involved, describe default behavoiur
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "behavoiur" should be "behaviour" (or "behavior" in American English).

Suggested change
- When optional parameters are involved, describe default behavoiur
- When optional parameters are involved, describe default behaviour

Copilot uses AI. Check for mistakes.
- Document edge cases of a function.
- Do not document types of a function and arguments, unless necessary. All type
annotations will be added by a documentation tool.
- Doc lines, just as code, can not exceed width of 80 characters.
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: "can not" should be "cannot" (one word when expressing inability).

Suggested change
- Doc lines, just as code, can not exceed width of 80 characters.
- Doc lines, just as code, cannot exceed width of 80 characters.

Copilot uses AI. Check for mistakes.

### Int64

`Int64` is a builtin type, which means that the there is no declaration
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammatical issue: remove "the" before "there" - should be "which means that there is".

Suggested change
`Int64` is a builtin type, which means that the there is no declaration
`Int64` is a builtin type, which means that there is no declaration

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants