Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTask docs #393
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vilterp
Sep 6, 2015
Having a type variable never here and a type Never in elm-effects might be confusing. Maybe an argument for moving the Never type to core and using it here?
vilterp
commented
Sep 6, 2015
|
Having a type variable |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rgrempel
Sep 6, 2015
Contributor
I might be misunderstanding, but I believe the lower-case never is just documentation -- it essentially means that the error type is unconstrained -- since it never happens, the type system need not care about it. Whereas the upper-case Never is, technically, an actual type. So (and I may be missing something here) it seems like one would be over-constraining the type checker by making Task.toMaybe return a Task Never (Maybe a). Whereas making it return a Task never (Maybe a) is just documentation.
|
I might be misunderstanding, but I believe the lower-case |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Sep 7, 2015
Member
Yeah, @rtfeldman and I discussed this. Richard, can you give more context on these things? Often when we discuss things offline, that info does not make it into the PR or issue and leads to confusion.
I'd be curious to see @vilterp's thoughts on the reasoning.
|
Yeah, @rtfeldman and I discussed this. Richard, can you give more context on these things? Often when we discuss things offline, that info does not make it into the PR or issue and leads to confusion. I'd be curious to see @vilterp's thoughts on the reasoning. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rtfeldman
Sep 7, 2015
Member
Yep, sorry about that!
My understanding is that @rgrempel's comment is correct as to what the distinction implies.
As for motivation, the reason I wanted to rename it was for searchability; if you are currently working with elm-effects and you think "okay, I need to get to a Never", you reflexively bring up the Task docs and search for "never" to see what comes back. Currently nothing comes back, so I have to hunt function by function until I find one whose docs indicate it'll do what I need.
Changing it to Never would be overly restrictive, but changing it to never makes it searchable. Granted, it could make people wonder "why is it capitalized in one place and not the other?" but that seems like the least painful of the options on the table.
|
Yep, sorry about that! My understanding is that @rgrempel's comment is correct as to what the distinction implies. As for motivation, the reason I wanted to rename it was for searchability; if you are currently working with elm-effects and you think "okay, I need to get to a Never", you reflexively bring up the Task docs and search for "never" to see what comes back. Currently nothing comes back, so I have to hunt function by function until I find one whose docs indicate it'll do what I need. Changing it to |
rtfeldman commentedSep 5, 2015
This revises the
Taskdocs to be more helpful toelm-effectsusers searching for how to obtain tasks that can never fail.The resulting docs json file:
task-docs.json