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

Clean things up some #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Clean things up some #2

wants to merge 3 commits into from

Conversation

treeowl
Copy link

@treeowl treeowl commented Aug 7, 2018

  • Use view instead of splitAt.
  • Use pattern guards to clarify.
  • Remove redundant constraints.
  • Make the constructor strict, which is semantically correct
    and should make things easier for the optimizer.
  • Get rid of the existential quantification. This is a breaking
    change, but I think it's the Right Thing. It should
    help the specializer a lot and sometimes reduce allocation.
    Almost no other packages use an existential the way this did.
  • Generalize the type of median to produce non-Double results.
  • Add a version of median specialized to the case where the element
    type is the same as the result type.
  • Get rid of popAndSwap. Inlining it removes an incomplete
    pattern match and I think also makes the code significantly
    clearer.
  • Document invariants.
  • Make the test suite fail properly when things are broken

* Use `view` instead of `splitAt`.
* Use pattern guards to clarify.
* Remove redundant constraints.
* Make the constructor strict, which is semantically correct
  and should make things easier for the optimizer.
* Get rid of the existential quantification. This is a breaking
  change, but I think it's the Right Thing. It should reduce
  help the specializer a lot and sometimes reduce allocation.
  Almost no other packages use an existential the way this did.
* Generalize the type of `median` to produce non-`Double` results.
* Add a version of `median` specialized to the case where the element
  type is the same as the result type.
* Get rid of `popAndSwap`. Inlining it removes an incomplete
  pattern match and I think also makes the code significantly
  clearer.
* Document invariants.
* Make the test suite fail properly when things are broken.
@treeowl
Copy link
Author

treeowl commented Aug 8, 2018

The CI failures are not my fault. It looks like some dependencies need to be updated upstream.

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.

1 participant