Stream: beginners

Topic: CP-style Task wrapper


view this post on Zulip Nicolo Davis (Feb 29 2024 at 01:13):

I'm curious if the CP-style Task wrapper outlined at https://youtu.be/7SidSvJcPd0?t=2064 ever got implemented? Was there a reason that got dropped in favor of the current approach? Just trying to learn some of the internals and the design decisions behind them.

view this post on Zulip Richard Feldman (Feb 29 2024 at 01:15):

we're still working on implementing it!

view this post on Zulip Richard Feldman (Feb 29 2024 at 01:16):

it's being worked on as recently as earlier today :big_smile:

view this post on Zulip Nicolo Davis (Feb 29 2024 at 01:47):

Oh I see :)

view this post on Zulip Nicolo Davis (Feb 29 2024 at 01:57):

I was trying to use this pattern for a Haskell project I was working on and gave up after realizing that I would need to enumerate all the possible types for the continuations in the Operation type:

data Operation = Op1 (Int -> Operation) | Op2 (String -> Operation) | ...
type Effect a = (a -> Operation) -> Operation

(it didn't seem like there was an easy way to make Operation polymorphic in this case)

I'm guessing that Roc doesn't have this problem because all the operations are well defined and finite in number?

view this post on Zulip Richard Feldman (Feb 29 2024 at 02:20):

yeah exactly

view this post on Zulip Richard Feldman (Feb 29 2024 at 02:21):

the platform knows exactly which operations it supports!


Last updated: Jul 06 2025 at 12:14 UTC