json
json copied to clipboard
explain that map2 takes a constructor function as first argument
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.