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

Add cross #3

Closed mgold closed 8 years ago

mgold commented 8 years ago

It would be helpful to have this function:

cross : List a -> List b -> List (a,b)

cross [1,2,3] ["a", "b"] = [(1, "a"), (1, "b"), (2, "a"), (2, "b"), (2, "a"), (2, "b")]

The use case I have in mind is getting a list of grid intersections, e.g. cross [0..m] [0..m].

jvoigtlaender commented 8 years ago

That's just lift2 (,) with the function lift2 already in this package. Is it really worth an extra function?

mgold commented 8 years ago

Nope, although a documentation comment might be nice :)