Skip to content

Conversation

@matthewleon
Copy link
Contributor

Returns a Tuple as in Haskell. See purescript/purescript-arrays#102

@matthewleon matthewleon force-pushed the partition-squashed branch from 7b5db2a to 801f53b Compare May 30, 2017 16:51
@matthewleon
Copy link
Contributor Author

Just realized that there was a commented-out previous attempt at this. Have removed it in this PR.

@hdgarrood
Copy link
Contributor

Most core libraries do tend to prefer records over tuples, as it is much easier to remember which part of the result is which this way. Thanks for this but I think I prefer it how it is now.

@hdgarrood
Copy link
Contributor

Oh, didn't realise this function doesn't exist here yet! Okay yeah looks good except I think it would be better to use the same style as in arrays currently.

@matthewleon
Copy link
Contributor Author

Okay, I'll adjust this accordingly. Thanks.

@matthewleon
Copy link
Contributor Author

Should be good now.

Copy link
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

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

LGTM

@michaelficarra
Copy link

true and false might be better than yes and no.

@matthewleon
Copy link
Contributor Author

true and false might be better than yes and no.

I am inclined to agree, but purescript-arrays sets a precedent here that I'm following. Are there any other packages that use a true/false convention?

@LiamGoodacre
Copy link
Member

Btw what's the reason behind using reverse and foldl for strict lists?

Also, these were also added for lists in purescript-filterable not long ago :)

@garyb
Copy link
Member

garyb commented Jun 1, 2017

Btw what's the reason behind using reverse and foldl for strict lists?

Stack safety, if I remember rightly.

@LiamGoodacre
Copy link
Member

Oh, looks like foldr is also defined by reverse and foldl 😄 https://github.com/purescript/purescript-lists/blob/master/src/Data/List/Types.purs#L68

@matthewleon
Copy link
Contributor Author

Btw what's the reason behind using reverse and foldl for strict lists?

Also, these were also added for lists in purescript-filterable not long ago :)

Thanks @LiamGoodacre for this. I've basically copied your work over from purescript-filterable. I forgot about foldr being implemented in terms of foldl anyway, so it seems to me that your take on this one is indeed more elegant.

@paf31 paf31 merged commit b7103d8 into purescript:master Jun 3, 2017
@paf31
Copy link
Contributor

paf31 commented Jun 3, 2017

Thanks!

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.

6 participants