Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMaybe.concat and Maybe.concatMap #788
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Dec 19, 2016
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Dec 19, 2016
|
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Dec 19, 2016
Member
Some quick thoughts I have:
concatMap and andThen are the same function, and concat can be derived from it as andThen identity. So the value here would be mostly in the names of the functions for consistency across List and Maybe rather than in previously unavailable functionality.
In any case, @FRosner, these kind of changes need to be discussed on the mailing list before any code gets accepted. Can you bring this up on elm-dev and get some feedback from other folks?
|
Some quick thoughts I have: In any case, @FRosner, these kind of changes need to be discussed on the mailing list before any code gets accepted. Can you bring this up on elm-dev and get some feedback from other folks? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
FRosner
Dec 20, 2016
Contributor
You are totally right @lukewestby ¬_¬
So I guess I'll have to bring this up to the mailing list in terms of the consistency discussions (flatMap being called concatMap in List and andThen in Maybe).
Thanks for the comment.
|
You are totally right @lukewestby ¬_¬ So I guess I'll have to bring this up to the mailing list in terms of the consistency discussions ( Thanks for the comment. |
FRosner
closed this
Dec 20, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
richardhaven
Jan 10, 2017
Emerson
As these methods do different things, rather than the same things on different objects, it is almost confusing that they have the same names.
richardhaven
commented
Jan 10, 2017
|
Emerson As these methods do different things, rather than the same things on different objects, it is almost confusing that they have the same names. |
FRosner commentedDec 19, 2016
Problem
Elm does not have a generic implementation of higher order collection functions like
map,filter,flatten/concat, etc. While this is not a problem per se it is useful to have the individual APIs available in a consistent way. This way you can generalize the API in your head when using it.While, e.g.,
List.concatandList.concatMapexists, there is noMaybe.concatandMaybe.concatMapavailable.Solution
Implement
Maybe.concatandMaybe.concatMapin order to have a consistent API of both functions betweenListandMaybe.Note
I read that you are strict about extending the core API and new functions should be proposed to
*-extrafirst. While this makes sense for contributions that introduce additional concepts, this contribution adds already existing functionality to a place where it is missing. I think that having a consistent collection API is a strong feature and useful to have in the core API.Anyway,❤️ Elm.