-
Hey :) I have a quick question about Effekt's current expressive power: def 2p[A](p: Parser[A]): Parser[A] = p.andThen(p) In Effekt, programs are computations that are mostly combined in direct style, using second-class blocks when you want to take a program as an input: def 2p[A] { p: A } : A / Parser = p() ; p() Now, am I correct to assume the following signature is not currently expressible in Effekt? def alternatives[A](ps: List[Parser[A]]): Parser[A] = ... fold with `orElse` .... and that you would have to write the equivalent of : val ps: List[Parser[MyA]] = List(p1, p2, p3)
val p: Parser[MyA] = alternatives(ps) as a series of direct calls to something like def p: MyA / Parser = or { p1() } { or { p2() } { p3() } } I understand why second class blocks are important in Effekt's current design btw, I just want to make sure I get the full implications in code. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey Fabio, sorry for the late response (I need to figure out how to turn on notifications ;) ) First of all, very good question. Indeed, everything you said is 100% correct. The limitation that Effekt (as described in our OOPSLA20 paper) does not have first-class functions means that computation cannot be thunked and treated first-class. It can (of course) be thunked and treated second-class, but that excludes the list example. We have been working on lifting this restriction, which resulted in a new core calculus "System-C". You can find an implementation and a copy of our paper here: https://github.com/se-tuebingen/oopsla-2022-artifact Our main motivation to bring back first-class functions was to
We have not yet fully implemented all features of System C back in Effekt; but this is on our bucket list. |
Beta Was this translation helpful? Give feedback.
Hey Fabio, sorry for the late response (I need to figure out how to turn on notifications ;) )
First of all, very good question. Indeed, everything you said is 100% correct.
The limitation that Effekt (as described in our OOPSLA20 paper) does not have first-class functions means that computation cannot be thunked and treated first-class.
It can (of course) be thunked and treated second-class, but that excludes the list example.
We have been working on lifting this restriction, which resulted in a new core calculus "System-C". You can find an implementation and a copy of our paper here:
https://github.com/se-tuebingen/oopsla-2022-artifact
Our main motivation to bring back first-class funct…