Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added basic documentation of Prelude module #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kiczor
Copy link

@Kiczor Kiczor commented Feb 14, 2025

No description provided.

Copy link
Member

@forell forell left a comment

Choose a reason for hiding this comment

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

In general this kind of information should be in the source files themselves, so that the documentation can be generated automatically one day. However, since such a tool doesn't exist yet, I'm ok with accepting hand-written docs in case they're helpful to people in the interim.

I don't think the proposed format of the documentation is ideal, mainly because the function signatures are missing. Additionally, none of the definitions exposed by the Prelude and defined in various files in lib/Base are mentioned here (even as uncommented stubs of entries, line near the end of the list in this PR), which may be confusing if someone expects this page to be an exhaustive list of what's provided.

@@ -1,3 +1,44 @@
# Prelude

The `Prelude` module is automatically imported and opened in all programs.

### Available functions:
Copy link
Member

Choose a reason for hiding this comment

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

Why skip a header level like this? Also, the title shouldn't end with ":" and should probably be in title case.

### Available functions:

---
`flip f` returns function with flipped arguments
Copy link
Member

Choose a reason for hiding this comment

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

I think the documentation would be more usable if each entry started with a codeblock with a particular function's scheme.

The descriptions following that should probably be in the form of sentences, with full stops and capitalization when applicable.

---
`flip f` returns function with flipped arguments

`flip f x y = f y x`
Copy link
Member

Choose a reason for hiding this comment

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

When a paragraph consists of a single piece of inline code then it should probably be a codeblock.

`flip f x y = f y x`

---
`fst p` returns first element of a pair `p`
Copy link
Member

Choose a reason for hiding this comment

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

Many of these descriptions are missing articles, like "the first element".

`charListToStr xs` converts list of characters `xs` into `String`

---
`chr n` converts integer `n` to corresponding ASCII character (`0 <= n <= 256` to work properly)
Copy link
Member

Choose a reason for hiding this comment

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

First of all, typo in the range. Should be n < 256. Second, what happens if it isn't? The bit about "to work properly" is too vague.

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.

2 participants