Skip to content

Add partition to Data.Array #59

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 3 commits into from
Feb 27, 2016
Merged

Add partition to Data.Array #59

merged 3 commits into from
Feb 27, 2016

Conversation

raichoo
Copy link
Contributor

@raichoo raichoo commented Feb 26, 2016

I needed a partition function for Arrays so I made one. Pointers welcome, this currently feels like the straightforward way to implement it.

@raichoo
Copy link
Contributor Author

raichoo commented Feb 26, 2016

Interestingly enough this seems to break in a line that I didn't touch. I'm not familiar with the tools complaining here so I'm not sure if this is actually my mistake, it certainly looks like it isn't to me.

@garyb
Copy link
Member

garyb commented Feb 26, 2016

Ugh, it's not you, jshint broke something a while ago. Can you change this line to "strict": "global", please? That should fix it.

I'm also amazed we don't already have partition 😄

@raichoo
Copy link
Contributor Author

raichoo commented Feb 26, 2016

Good to know :) So was I ^^.

@raichoo
Copy link
Contributor Author

raichoo commented Feb 26, 2016

All fixed now.

-- | and one for values that don't.
foreign import partition :: forall a. (a -> Boolean)
-> Array a
-> { yes :: Array a, no :: Array a }
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the return type, I frequently have to consult Hackage to remember the right way round in Haskell for things like this.

@paf31
Copy link
Contributor

paf31 commented Feb 27, 2016

👍 LGTM, but could you please run pulp docs?

@raichoo
Copy link
Contributor Author

raichoo commented Feb 27, 2016

On its way. The output surprised me however. I looks like it touched more of the documentation than I actually changed.

@paf31
Copy link
Contributor

paf31 commented Feb 27, 2016

It looks like we forgot to build it last time something was merged.

Looks good, thanks!

@sharkdp
Copy link
Contributor

sharkdp commented Feb 27, 2016

Looks good to me, too.

garyb added a commit that referenced this pull request Feb 27, 2016
Add `partition` to Data.Array
@garyb garyb merged commit e47d505 into purescript:master Feb 27, 2016
@garyb
Copy link
Member

garyb commented Feb 27, 2016

Thanks @raichoo!

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.

4 participants