You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pub effect yield<a>
ctl yield(elem : a) : ()
pub fun repeat(value : a) : (() -> <yield<a>,div> ())
fun rec()
yield(value)
rec()
rec
This does not:
pub alias stream<a,e> = () -> <yield<a>|e> ()
pub fun repeat(value : a) : stream<a,div>
fun rec()
yield(value)
rec()
rec
repro(1, 1): internal error: Type.TypeVar.subNew.KindMismatch: length 2: (19::KCon V |-> 63::KCon V)
(20::KCon E |-> std/core/types/div::KCon X)
CallStack (from HasCallStack):
error, called at src\Common\Failure.hs:46:12 in koka-3.1.3-5fapaLngEoI9NoFrdTDxYE:Common.Failure
raise, called at src\Common\Failure.hs:32:5 in koka-3.1.3-5fapaLngEoI9NoFrdTDxYE:Common.Failure
failure, called at src\Common\Failure.hs:28:11 in koka-3.1.3-5fapaLngEoI9NoFrdTDxYE:Common.Failure
assertion, called at src\Type\TypeVar.hs:163:9 in koka-3.1.3-5fapaLngEoI9NoFrdTDxYE:Type.TypeVar
subNew, called at src\Kind\Infer.hs:1498:79 in koka-3.1.3-5fapaLngEoI9NoFrdTDxYE:Kind.Infer
Unless I'm missing something, I think the second snippet should compile as well, but otherwise this should give a normal error I think.
The text was updated successfully, but these errors were encountered:
Yeah, we should have a normal error here:
Change stream<a,div> to stream<a,<div>>. Anything that should unify with e in |e needs to be a full effect row - which could be itself polymorphic if you want. It can't be a single effect label.
Yeah, I think it confuses people because if you only have a single effect in a function type, you can omit the row angle brackets in the effect type - but that only works for function types, not anywhere else a row is expected.
This compiles:
This does not:
Unless I'm missing something, I think the second snippet should compile as well, but otherwise this should give a normal error I think.
The text was updated successfully, but these errors were encountered: