Skip to content
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

Fix: Object typing for bidirectional effects #361

Merged
merged 33 commits into from
Feb 20, 2024
Merged

Conversation

dvdvgt
Copy link
Collaborator

@dvdvgt dvdvgt commented Jan 16, 2024

This issue is to close #152.

Description

Check #152 for details.

Tasks

Changelog

  • Breaking: Deprecate effect ... { ... } notation in favour of interface ... { ... }. effect ... is now only allowed for singleton interfaces.
  • Add support for block parameters for operations

@dvdvgt dvdvgt changed the title Fix: Object Typing Fix: Object typing for bidirectional effects Jan 16, 2024
import effekt.source.{ AnyPattern, Def, IgnorePattern, MatchPattern, ModuleDecl, Stmt, TagPattern, Term, Tree, resolve, symbol }
import effekt.symbols.*
import effekt.source.{AnyPattern, Def, Effectful, IgnorePattern, MatchPattern, ModuleDecl, Stmt, TagPattern, Term, Tree, resolve, symbol}
import effekt.symbols.{BlockType, Capture, *}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably added by accident in IntelliJ

@dvdvgt dvdvgt marked this pull request as ready for review February 1, 2024 17:01
@b-studios
Copy link
Collaborator

I minimized one of the failing tests to

interface Compose {
    def compose[A, B] {g: A => B}: A => B at {g}
}

def handler {prog: () => Unit / Compose} =
  try { prog() } with Compose {
    def compose[F, G]() = ()
  }

def main() = handler { do compose[Int,  Int] { x => 1 }; () }

In fact, bidirectional handlers are not yet implemented in backends other than JS (I don't know about LLVM, TBH; @phischu ?).

@b-studios
Copy link
Collaborator

I think it is fine to ignore the failing test for the ML backend for now and document it as "mutual recursion not supported".

@b-studios b-studios mentioned this pull request Feb 20, 2024
@b-studios b-studios merged commit 479f534 into master Feb 20, 2024
1 check passed
@b-studios b-studios deleted the fix/object-typing branch February 20, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Effectful signatures are not implemented for objects
2 participants