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

High-order functions: patterning functions #66

Open
Bubobubobubobubo opened this issue Oct 12, 2023 · 0 comments
Open

High-order functions: patterning functions #66

Bubobubobubobubo opened this issue Oct 12, 2023 · 0 comments

Comments

@Bubobubobubobubo
Copy link
Owner

Topos recently started to acquire patterning capabilities but patterns are mostly constituted of values: [1,2,3].beat(). This is nice, but it should not stop there.

It would be nice to be able to pattern function application: [1,2,3].apply([reverse(2), palindrome].bar()).beat(). This is already possible but there is currently two issues:

  • it is ugly. The syntax could be better to do so!
  • the code is not optimised to do so. You have to declare the reverse two times, once as a general high-order functions and a second time for the data structure inheriting that capability.

The work to make this better is rather easy. Strudel is using a register() function that is mapping high-order functions to different data structures. Topos should probably do the same to be a cool algorithmic pattern language.

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

No branches or pull requests

1 participant