-
Notifications
You must be signed in to change notification settings - Fork 58
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
Change group/groupWhile to use a tuple to represent a non-empty list #103
Conversation
See #49 for related discussion. |
Discussion seems to have fizzled out on this. To move forward, how about we merge this, in conjunction with a handful of non empty list helper functions, such as.. mapNonEmpty : (a -> b) -> (a, List a) -> (b, List b)
toNonEmpty : List a -> Maybe (a, List a)
fromNonEmpty : (a, List a) -> List a ..is that a good plan? |
I'm kind of against that proposal. At the end of the day we'll have a whole lot of duplicate functions just for dealing with non-empty lists that will pollute the library (you mentioned 3 or 4 functions in particular but why should we stop there?). Maybe this stuff belongs in a different package or module. Also, FYI toNonEmpty is the same thing as uncons. |
If we do decide to merge this PR, which again I don't think we should do, some work needs to be done.
|
We talked about this in the issues and came to the conclusion that we should merge this without any helpers. If anyone needs any helpers later we can always add them. |
Oh, and I will publish this with the next major update, which I would estimate will be within a month or two. |
Please make sure the comments I made above are addressed before publishing. |
Right, forgot about that, sorry. I will write that down and make sure those items are in the next release. I am going to have to sit down and solve some merge conflicts for the next release anyway. Unless @loganmac wants to do it (no pressure tho). |
Okay, I have implemented those remaining changes in the Rather than update Here is a demo: https://ellie-app.com/32KL9L2NtPKa1 Im worried this is too rushed. Its just some code I wrote up and pushed. So if you have any review of it I would appreciate it. |
LGTM. Sorry for not getting to it sooner. |
Quote from @evancz in the slack:
This PR does just that.