effect type problem #238
Replies: 5 comments 5 replies
-
This aspect of programming with effects is a little underdocumented in Koka. As far as I understand it, all effects that are polymorphic should have the same row of concrete effects. So in your case that means you should add
You can do this because you exhibit the |
Beta Was this translation helpful? Give feedback.
-
In this case, you can also fix the problem by just removing the type signatures and letting Koka do the work:
where Koka infers:
|
Beta Was this translation helpful? Give feedback.
-
You can also mask |
Beta Was this translation helpful? Give feedback.
-
I think I've been seeing the same thing... I had
which gives me this error in the
Making the effects for the
makes the type error go away... there's something odd going on with inference though... If i remove the
which indicates that koka is inferring the wrong type for the results of When i add the |
Beta Was this translation helpful? Give feedback.
-
Does anyone know if this is a type-theoretic limitation or if it's just that type inference in this case is not implemented. |
Beta Was this translation helpful? Give feedback.
-
Hallo there, I just stumbled upon koka and really like it.
So I just started trying out some stuff, now I wanted to write this little function for updating the value at an index of a list:
and get this error:
This doenst happen if I leave out the polymorphic effect in the update-function type. So its maybe about the compiler not knowing f can just be called once and thinking its an infinite effect type?
thanks in advance
chol
Beta Was this translation helpful? Give feedback.
All reactions