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

Corrections for Task documentation concerning use of == #557

Merged
merged 1 commit into from Apr 28, 2016

Conversation

Projects
None yet
3 participants
@halfzebra
Contributor

halfzebra commented Apr 10, 2016

Corrections for Task module documentation.

The relevant issue #502 was:

Documentation suggests that == works on tasks, but it doesn't

For example, the documentation of Task.map2 (http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Task#map2) contains this line:

map2 (+) (succeed 9) (succeed 3) == succeed 12

However, issuing that exact line in a program will actually evaluate to False. Very confusing, for example to @paparga here.

Maybe the documentation shouldn't be using == on tasks, and indeed maybe it should explicitly mention that == is wonky on tasks, as the documentation already says elsewhere about Dict etc.

(Note: For Dict etc., equality could potentially be made unwonky, but for tasks not.)

I have replaced all equality operators == with comment -- to standardize the style of the docs(before it had both in different places)

Also I have added a note, that == shoudn't be used with Tasks.

@jvoigtlaender jvoigtlaender changed the title from Corrections for Task documentation to Corrections for Task documentation concerning use of == Apr 11, 2016

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Apr 11, 2016

Contributor

An example of where already the current docs use -- instead of == is the documentation of onError, which has these lines:

fail "file not found" `onError` (\msg -> succeed 42) -- succeed 42
succeed 9 `onError` (\msg -> succeed 42)             -- succeed 9

This PR fixes the other examples on that doc page to be given in the same style (and thus avoids confusing uses of == on tasks).

Contributor

jvoigtlaender commented Apr 11, 2016

An example of where already the current docs use -- instead of == is the documentation of onError, which has these lines:

fail "file not found" `onError` (\msg -> succeed 42) -- succeed 42
succeed 9 `onError` (\msg -> succeed 42)             -- succeed 9

This PR fixes the other examples on that doc page to be given in the same style (and thus avoids confusing uses of == on tasks).

@evancz evancz merged commit 2226d1b into elm:master Apr 28, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Apr 28, 2016

Member

Thanks, makes sense!

Member

evancz commented Apr 28, 2016

Thanks, makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment