elm-community / list-extra

Convenience functions for working with List.

Home Page:http://package.elm-lang.org/packages/elm-community/list-extra/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal for `prepend`

EverybodyKurts opened this issue · comments

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.

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

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.

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