Thanks to visit codestin.com
Credit goes to github.com

Skip to content

remove Random extension#590

Merged
CrossEye merged 1 commit intoramda:masterfrom
davidchambers:random
Nov 29, 2014
Merged

remove Random extension#590
CrossEye merged 1 commit intoramda:masterfrom
davidchambers:random

Conversation

@davidchambers
Copy link
Member

I've nothing against this code, but it doesn't belong in Ramda. It should be a standalone package in its own repository. Do others agree?

@CrossEye
Copy link
Member

I wrote it, only in response to #168.

I don't have a strong attachment to it, but I do like having some answer to the question "does Ramda provide a shuffle function?"

@kedashoe
Copy link
Contributor

I don't have a strong attachment to it, but I do like having some answer to the question "does Ramda provide a shuffle function?"

#522 (comment)

@CrossEye
Copy link
Member

@kedashoe: It's hard to think of that 100-line sample as the answer to how you'd create one yourself, though.

@kedashoe
Copy link
Contributor

It's hard to think of that 100-line sample as the answer to how you'd create one yourself, though.

I see, not so much an example as something you want users to be able to add to R if they want. My suggestion does indeed seem the wrong place then!

@CrossEye
Copy link
Member

I see, not so much an example as something you want users to be able to add to R if they want.

Exactly. This function is a little too specialized, and frankly a little too large, to comfortably fit in Ramda itself. That's why we have an extension. But I'm sympathetic to @davidchambers' point that it still feels an odd fit, perhaps not the shuffle function itself, but the Random and Mash ones it depends on.

@davidchambers
Copy link
Member Author

Even the shuffle function seems out of place to me. It would be nice to be able to say Ramda functions are referentially transparent without caveats.

@CrossEye
Copy link
Member

That version of shuffle is referentially transparent. That is the point of the complex implementation.

@davidchambers
Copy link
Member Author

That version of shuffle is referentially transparent. That is the point of the complex implementation.

Oh I see! That addresses my concern. Feel free to close this pull request.

@CrossEye
Copy link
Member

Let's leave it for a day or two for others' input. It's a reasonable question. Not many people really want to use a shuffle function like that. And to use it in a referentially transparent way you also lose the real point of randomness. A repeatable PRNG is useful, but for a realistic use of it, you'll have to seed the Random with something actually random, likely a timestamp. That means that although technically referentially transparent, it's not really true in practice.

So let's think about this for a bit.

@davidchambers
Copy link
Member Author

Crickets

I say we cut it. :)

CrossEye added a commit that referenced this pull request Nov 29, 2014
@CrossEye CrossEye merged commit 992aff2 into ramda:master Nov 29, 2014
@davidchambers davidchambers deleted the random branch November 29, 2014 02:25
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.

3 participants