json icon indicating copy to clipboard operation
json copied to clipboard

explain that map2 takes a constructor function as first argument

Open lady3bean opened this issue 5 years ago • 0 comments

This PR map2 takes a type constructor function as its first argument.

Why?

If you don't know that a type alias generates a record constructor for you, then it's hard to see what's happening when we use Point in this example. When this is paired with misleading info about what map2 takes as arguments in the elm guide, it's hard to reason about what map2 takes as arguments. I've attempted to clarify this in the elm guide with this PR - https://github.com/evancz/guide.elm-lang.org/pull/243. I think that adding more explanation here will be helpful as well, particularly for beginners who might not be firm in their understanding of how a a type alias generates a record constructor.

lady3bean avatar Feb 26 '20 17:02 lady3bean