Is Task a specific case when we rely on the built-in implementation of Javascript tasks?
That's right. You will notice that the Task type, but not the Task tag (the thing on the right) is exported from the module, so you cannot actually access the latter. This is a placeholder to make the type system happy.
Instead, the built-in JavaScript implementation knows what tasks really exist, namely the JS object . Any secret module associated with tasks (either the Task module or any third-party library, for example elm-http ) is kept secret. However, the Task module exports a large number of helper functions, which can have great control over tasks using only libraries that have already been published.
Editing clarifications. Yes, you need to use a third-party library to get a task that really affects the outside world. To complete this task, you need to send it through the port; until you do this, the task is simply a description of the work being done.
mgold source share