koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.25k stars 161 forks source link

fix vector init #420

Closed TimWhiting closed 8 months ago

TimWhiting commented 9 months ago

Fixes: #416 Vector init wasn't working properly for control effects. I don't know if you'd rather just make the effect io-noexn, but it seems to me that we would at least want to support st<> or ref<> as well. Either way it probably should be documented that using multiple resumptions with this API is bad practice because it doesn't copy the vector.

I went through the rest of core.kk and made sure there were no more functions being passed to c that have polymorphic effect types.

daanx commented 8 months ago

Thanks for the help Tim! I ended up with a different approach but also used the new vector-init in koka itself to deal with control effects.