elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 59 forks source link

Proposal for `prepend` #44

Closed EverybodyKurts closed 7 years ago

EverybodyKurts commented 7 years ago

Here's an example (super easy way) of doing it:

prepend : List a -> List a -> List a
prepend prependee prepended =
    List.concat [ prepended, prependee ]

If can create a merge request with the appropriate docs and tests if approved.

mgold commented 7 years ago

You can already do prepended ++ prependee. This seems like a reverse of that, and doesn't seem worthwhile to me.

EverybodyKurts commented 7 years ago

Ha, I learned something new.

I'm fine with this decision. It's just weird to me that there's a List.append in the core library but no List.prepend. I also like to think that the two method names, append and prepend, are bit more intention revealing.

Anywho, just my two thoughts.

mgold commented 7 years ago

If you're fine with it, I'll close the issue.