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
effect state<a>
fun get() : a
fun put(x : a) : unit
fun state(s : a, f : () -> <state<a>,div|e> b) : <div|e> b
var st := s
with handler
get() { st } // notice the missing 'fun' keyword
fun put(s') { st := s }
f()
Since we forgot to write fun in front of get, we get an error message:
Type.Infer.inferHandler: using a bare operation is deprecated.
hint: start with 'val', 'fun', 'brk', or 'ctl' instead.
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/Type/Infer.hs:1105:43 in koka-3.1.1-GrUKw6cowJ9E7PPCKFMvzQ:Type.Infer
The error message itself is good and tells us how to fix the problem. However, this error message comes from a call to error and does not fit in nicely with the rest of Koka's error reporting. In particular, there is no syntax highlighting in VSCode.
The text was updated successfully, but these errors were encountered:
Consider the following state effect and handler:
Since we forgot to write
fun
in front ofget
, we get an error message:The error message itself is good and tells us how to fix the problem. However, this error message comes from a call to
error
and does not fit in nicely with the rest of Koka's error reporting. In particular, there is no syntax highlighting in VSCode.The text was updated successfully, but these errors were encountered: