Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

choose: the set of all subsets of specified size #45

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

Conversation

matthewleon
Copy link

No description provided.

@@ -176,3 +177,11 @@ intersection s1 s2 = fromFoldable $ runPure (runSTArray (emptySTArray >>= inters
LT -> pure $ Loop {a: l + 1, b: r}
GT -> pure $ Loop {a: l, b: r + 1}
else pure $ Done acc

-- | The set of all subsets of specified size
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the following are missing:

  • Running time, preferably in big O
  • An example in the docs
  • At least one full sentence in the docs - this seems a little unnecessarily abridged. In particular, what happens when the provided Int argument is larger than the size of the provided set?
  • Handling for the case where a negative Int argument is supplied.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, you're absolutely right. I threw both this and powerSet over the fence a bit prematurely. I'll fix them up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants