-
Notifications
You must be signed in to change notification settings - Fork 5
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
*.NonEmpty.Replicate #33
Comments
Isn't this just |
Actually, I think it's
|
Ok I was misunderstanding the method signature, I read it as a function to copy (misinterpreted "replicate") the first |
I was planning on adding a version of this method for the base modules as well, not just the NonEmpty modules. (the NonEmpty modules take a PositiveInt, so the base modules take a NaturalInt). If I call it List.replicate, then any user opening SafetyFirst will have List.replicate shadowed by the function requiring a NaturalInt instead of an int. I imagine we don't want to break code just by opening SafetyFirst. #44 has a similar situation where the type signature of groupBy should be changed by SafetyFirst, but we'd rather not override the function, and we want to reserve appending The idea suggested over there was to use a different (but close enough in intellisense) name for the function. Do we want to continue with that? How about We may want to consider if it would be annoying to have to guess whether the original or the "safe-signature" version is being used (e.g., "group" or "groupBy"?, "replicate" or "repeat"?, "init" or "initialize"?). I've gone through my keyboard and it looks like |
…d some basic Numbers members
…d some basic Numbers members
Please add the following function to the nonempty collection modules (not just List)
List.NonEmpty.replicate (count: PositiveInt) -> (value: 'a) -> NonEmptyList<'a>
The text was updated successfully, but these errors were encountered: