-
Notifications
You must be signed in to change notification settings - Fork 6
added basic documentation of Prelude module #7
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
# Prelude | ||
|
||
The `Prelude` module is automatically imported and opened in all programs. | ||
|
||
### Available functions: | ||
|
||
--- | ||
`flip f` returns function with flipped arguments | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 x y = f y x` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
--- | ||
`fst p` returns first element of a pair `p` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Many of these descriptions are missing articles, like "the first element". |
||
|
||
`fst (x, _) = x` | ||
|
||
--- | ||
`snd p` returns second element of a pair `p` | ||
|
||
`snd (_, y) = y` | ||
|
||
--- | ||
`not b` negates boolean value `b` | ||
|
||
--- | ||
`charListToStr xs` converts list of characters `xs` into `String` | ||
|
||
--- | ||
`chr n` converts integer `n` to corresponding ASCII character (`0 <= n <= 256` to work properly) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First of all, typo in the range. Should be |
||
|
||
--- | ||
`printStrLn` | ||
|
||
--- | ||
`printStr` | ||
|
||
--- | ||
`printInt` prints integer | ||
|
||
--- | ||
`readLine` reads line of input, returns `String` | ||
|
||
--- | ||
`exit` |
There was a problem hiding this comment.
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.