-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Add Task as a built-in module/type #6836
Conversation
It looks like there is a genuine issue with the False interpreter.
|
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sort.roc file is the only thing that needs to be addressed/clarified, all good for the rest 🎉
I"m hitting some issues with d3732b4:
After I removed the type annotation on main, I hit:
I tired several things without success, I"m going to revert the last commit for now. |
This reverts commit d3732b4.
Currently stuck on:
This is the only remaining test failure (when doing |
Lol, the valgrind errors:
|
I can continue investigating on Friday. |
We reduced all tests failures down to the same issue. After removing unsized tasks from the false-interpreter platform (the platform of the failing test), we still got a failure. Namely, the host returns If all tests pass, I vote that we call this good and merge, but I leave the final call to you @Anton-4. |
All tests should pass now 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
This change moves the
Task
opaque IO type from platform-specific implementations to the standard library of Roc. This PR is ready for review, barring final testing by building a pre-release ofbasic-cli
using the twin basic-cli PR. The high level changes are:Task
module from the basic-cli platform tocrates/compiler/builtins/roc/Task.roc
Task
andEffect
into just theTask
opaque type with definitionTask ok err := {} -> Result ok err
, which is the old type forEffect a : {} -> a
thatTask ok err : Effect (Result ok err)
wrappedEffect
generation code, as everything should useTask
directlygenerates Effect with [after, map, ...]
clause of the hosted module header, which is a breaking changeRocResult
s now, and FFI type declarations on the Roc side need to always haveTask
return typesEffect.after
,Effect.map
, etc. functions as they were needed to glueEffect
toTask
, but are no longer needed now that those types have been combinedEffect.roc
toPlatformTask.roc
to distinguish their behavior from the old approach and to give a name more descriptive of the new behaviorbasic-cli
works, that is on hold