Status of user defined effects and handlers? #6315
Replies: 10 comments 3 replies
-
We have been working on it for about two months, but with little progress. However, just recently we figured out what the major steps are. Unfortunately, I think it will take 2-6months before we have something working. What the status on the graded lib, i.e. what's the blocker / breaking change? We are currently looking into associated type aliases which may offer an alternative solution. If you DM me on Gitter a can send a bit more information. |
Beta Was this translation helpful? Give feedback.
-
Can you remind again where the casts show up? I have something like:
|
Beta Was this translation helpful? Give feedback.
-
Thanks Magnus The typical way I've been writing graded monads is here: https://github.com/stephentetley/graded-lib/blob/master/src/Graded/Codensity.flix I had been casting the constructor (e.g. line 65) which is now a runtime cast error in v0.38.0 and above. The monads are all written in the codensity style to be stack safe - I think I'm correct in saying Codensity is the Identity monad in CPS. I had envisaged needing only one or two of the monads as State, Reader etc. could be effects once we can write them in Flix. Casting the constructor was quite easy while it worked. I've managed to code
|
Beta Was this translation helpful? Give feedback.
-
I am still thinking about this. I suspect one issue is that in the definition of |
Beta Was this translation helpful? Give feedback.
-
Unfortunately we had to fix the old cast mechanism; it was simply broken and did not enable us to generate the code we need to add handlers. But as side-effect we probably broke your code :/ |
Beta Was this translation helpful? Give feedback.
-
From a practical standpoint, what would be downside -- as a temporary measure -- to simply assign the functions inside Codensity the |
Beta Was this translation helpful? Give feedback.
-
Thanks Magnus - I can get by with considerable fewer casts if I use IO iternally. I'll probably try and convert GradedLib to this style over the weekend.
I didn't realize increasing the effect in |
Beta Was this translation helpful? Give feedback.
-
I actually had something more like:
In mind. (I understand this is like disabling effect tracking or "programming with java.lang.Object everywhere") |
Beta Was this translation helpful? Give feedback.
-
@stephentetley Unofficially support is starting to arrive. I am writing up a document with what works and what does not. If you swing by Gitter I can share it with you. Officially we are not announcing this feature until more infrastructure and tests are in place. |
Beta Was this translation helpful? Give feedback.
-
Thanks Magnus, I'm busy for the next few days, but I will check Gitter later in the week. |
Beta Was this translation helpful? Give feedback.
-
What is the status of user defined effects and handlers?
This has become rather an active issue for me as
unchecked_cast
changed between versions 0.37.0 and 0.38.0 so myGradedLib
of graded functors, applicatives and monads no longer works. Using casts to help constructors capture effects was always a bit unseemly so I'm not clamoring for old behavior to be reactivated but I am wondering what to do for my libraries that depended onGradedLib
in the meantime until we have user defined effects.Beta Was this translation helpful? Give feedback.
All reactions