Skip to content

[BREAKING] Iterator groupby #87

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

Closed
wants to merge 5 commits into from
Closed

[BREAKING] Iterator groupby #87

wants to merge 5 commits into from

Conversation

paf31
Copy link
Contributor

@paf31 paf31 commented Dec 24, 2016

Reopening #84 after my mistake (this requires a major release)

For instances where you want to return more than just one STArray from
an STArray computation. For example, a pair of STArrays (with
potentially different types), or an STArray of STArrays, or even an
STArray of nonempty STArrays. The possibilities are endless!

Also use unsafe-coerce instead of FFI.
Implement `groupBy` using `Data.Array.ST.Iterator`; this should make it
faster.
\x y -> odd x && odd y is not an equivalence relation! It doesn't
satisfy reflexivity.
@paf31 paf31 changed the title Iterator groupby [BREAKING] Iterator groupby Jan 10, 2017
@hdgarrood
Copy link
Contributor

Maybe we can do this in a non-breaking way by marking runSTArray as deprecated and also exporting a new function unsafeFreeze :: forall h a eff. STArray h a -> Eff (st :: ST h | eff) (Array a) which requires the caller to ensure that the original STArray is not modified afterwards? That would also make the API (as well as code that uses it) a bit simpler, I think: e.g. you no longer need to define a newtype to implement things like groupBy.

@hdgarrood
Copy link
Contributor

I'm going to try this in a separate branch and see how much I like it.

@hdgarrood hdgarrood mentioned this pull request Jan 19, 2017
@hdgarrood
Copy link
Contributor

Resolved by #89.

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