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

Remove switch operator, implement simple fallback core operator, use … #2685

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

toots
Copy link
Member

@toots toots commented Oct 11, 2022

…cross to define top-level fallback operator, define switch using it.

@toots toots force-pushed the switch-transitions branch from a62e650 to 48b0378 Compare October 11, 2022 18:05
…cross to define top-level fallback operator, define switch using it.
@toots toots force-pushed the switch-transitions branch from 48b0378 to 40b5dee Compare October 11, 2022 21:04
@smimram
Copy link
Member

smimram commented Oct 14, 2022

I think the best abstraction would be a select operator such that

select(f, l)

with

  • f of type unit -> int
  • l of type source list
    plays the f()th source.

We can implement fallback over this.

@toots
Copy link
Member Author

toots commented Oct 14, 2022

I think the best abstraction would be a select operator such that

select(f, l)

with

  • f of type unit -> int
  • l of type source list
    plays the f()th source.

We can implement fallback over this.

Can you explain more in details why? I'm not sure the benefit is immediate to me.

There's a complex interaction between source.is_ready and switch predicates that makes switch implementation tricky. When starting with a fallback based on source.is_ready, the low-level implementation is pretty straight forward. Then we can build on top of that using source.available to implement the switch, still following a strict logic based on source availability..

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.

2 participants