-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicits #68
Implicits #68
Conversation
The current design allows users to write programs like (I'll keep this updated) implicit ^x : int
implicit ^y : int
implicit ^foo<a> : (a, a)
fun test() : ^x int {
^x + ^x
}
fun test2() {
val ^x = { "hello".print; ^x + 4 }
test()
}
fun res() {
val ^x = 3
test2()
}
val manual = handle(test) { ^x() -> resume(4) }
fun test3() {
^x + ^y
}
fun test4() : < ^foo<int> > int {
^foo.fst + ^foo.snd
} if operations look like implicit parameters, we can use the sugar on them effect manualImplicit {
fun ^man() : int
}
fun test5() {
^man + ^x
}
fun test5handled() {
val ^man = 42
val ^x = 2
test5()
} |
I now turned implicits into legal identifiers. Using the Of course the syntax can only be temporary as it also conflicts with exponentials. |
I added with (^x = 4, ^y = ^x+2) test3() for {
val ^x = 4
val ^y = ^x + 2
test3()
} |
Ok, I switched back to |
First draft of implementing implicits in terms of effect handlers
This PR is just for discussion and not meant to be merged