Open anfelor opened 3 years ago
Ouch! thanks for the reports -- it is a busy time for me until ICFP but will look at this later :-)
One problem I can see is that div
is not maskable as it never can be handled. (there is only one conceptual builtin handler for this that provides the fix
operation)
@daanx It's not that urgent, I just wanted to note down these issues here :)
In Koka 3.1.1, writing mask<st>
still fails with:
Invalid type
type context : mask<st>
type : st
inferred kind: H -> E
expected kind: X
because : Can only inject effect constants (of kind X)
while writing mask<st<h>>
fails with:
Type.TypeVar.subNew.KindMismatch: length 1: (1033::KCon H |-> 107::KCon V)
CallStack (from HasCallStack):
error, called at src/Common/Failure.hs:46:12 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Common.Failure
raise, called at src/Common/Failure.hs:32:5 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Common.Failure
failure, called at src/Common/Failure.hs:28:11 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Common.Failure
assertion, called at src/Type/TypeVar.hs:119:13 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Type.TypeVar
subNew, called at src/Kind/Infer.hs:1136:79 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Kind.Infer
(notice that the latter exception is from an error
call and does not render nicely in vscode).
It is currently impossible to use an effect synonym like
st
in mask, but that means that one has to mask three effects instead of one. Similar code as in #153:Here it would be preferable to write
mask<st>
instead of three separate masks onread,write,alloc
.