Skip to content

Improve Data.Set module docs. #502

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

Merged
merged 4 commits into from
Jan 22, 2018
Merged

Conversation

m-renaud
Copy link
Contributor

This improves the module level docs for Data.Set following the form of the recent improvements to Data.Sequence. This is for the most part a re-organization of the existing content with a few minor changes so should hopefully be uncontroversial.

Rendered docs can be found here.

Partially addresses #495.

@m-renaud m-renaud added the docs label Jan 22, 2018
Data/Set.hs Outdated
-- = Sets
--
-- The @'Set' e@ type represents a set of /unique/, /ordered/ elements of type
-- @e@.
Copy link
Contributor

Choose a reason for hiding this comment

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

What are ordered elements? What is a unique element? I think perhaps

-- The @'Set' e@ type represents a set of elements of type @e@. Most operations
-- require that @e@ be an instance of the 'Ord' class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Data/Set.hs Outdated
-- first argument are always preferred to the second, for example in
-- 'union' or 'insert'. Of course, left-biasing can only be observed
-- when equality is an equivalence relation instead of structural
-- equality.
Copy link
Contributor

Choose a reason for hiding this comment

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

See my note on Map. Also, rather than "left-biasing", how about "this bias"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Data/Set.hs Outdated
--
-- Here are some examples that illustrate the property:
--
-- > delete undefined s == undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

This demonstrates nothing. How about

-- > insert undefined xs == undefined
-- > singleton undefined = undefined

Copy link
Contributor Author

@m-renaud m-renaud Jan 22, 2018

Choose a reason for hiding this comment

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

I've removed the strictness section (as I did in the map docs). All the information here is in the first section that discusses the strictness of the element type.

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2018

I don't see the update.

@m-renaud
Copy link
Contributor Author

Oops, accidentally sent the review comments before pushing the commit. I thought I had "started a review" which I was going to finish after the commit went up. I'll have it up shortly, about to walk to work.

@m-renaud
Copy link
Contributor Author

Changes pushed, Haddocks haven't been pushed again because its a pain to get both changes built simultaneously because they're in different branches.

Data/Set.hs Outdated
-- = Finite Sets
--
-- The @'Set' e@ type represents a set of elements of type @e@. A 'Set' is
-- strict in the element type and most operations require that @e@ be an
Copy link
Contributor

Choose a reason for hiding this comment

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

Surely you mean strict in its elements, not their type. I think you should move the strictness to a new sentence after the one about Ord.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yup that what I meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this should just be a bullet list, it may read better since both the sentences are so short. WDYT?

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2018 via email

@m-renaud
Copy link
Contributor Author

m-renaud commented Jan 22, 2018

How about: Most operations require that @e@ be an instance of the 'Ord' class, and all operations are strict in the element.

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2018 via email

@m-renaud
Copy link
Contributor Author

Gotcha, I'll leave it as is. Are there any other changes you'd like made or can this be merged?

@treeowl treeowl merged commit 85fb64c into haskell:master Jan 22, 2018
@m-renaud m-renaud deleted the docs-set-module branch January 22, 2018 18:37
@m-renaud m-renaud mentioned this pull request Jan 24, 2018
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants