Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain that map2 takes a constructor function as first argument #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lady3bean
Copy link

@lady3bean lady3bean commented Feb 26, 2020

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 - evancz/guide.elm-lang.org#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant