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

Request for procedures #12

Open
wiebecommajonas opened this issue Jun 30, 2022 · 1 comment
Open

Request for procedures #12

wiebecommajonas opened this issue Jun 30, 2022 · 1 comment

Comments

@wiebecommajonas
Copy link

Description

A shaping applies rules 'at compile time' whereas a procedure would apply the rules 'at runtime'.

Example

Disclaimer: This example assumes the usage of the 'all' strategy as described in #11, because I could not come up with a different example.

eq_f :: eq(bool(true), bool(false)) = bool(false)
eq_t :: eq(bool(A), bool(A)) = bool(true)

basic_comm :: B(X, Y) = B(Y, X)

# eq_resolve :: eq(bool(A), bool(B)) {
#     eq_t | all
#     eq_f | all
#     basic_comm | all
#     eq_f | all
# }
# 
# result: eq(bool(A), bool(B))

proc eq_resolve :: eq(bool(A), bool(B)) {
    eq_t | all
    eq_f | all
    basic_comm | all
    eq_f | all
}

eq(bool(false), bool(true)) {
    eq_resolve | all
}

# expected result: bool(false)
@rexim
Copy link
Member

rexim commented Oct 10, 2023

I like the idea of reusable sequence of rule transformations. Not sure if I like it in a form you suggested, but I'll think about how I want to go about it. Thanks!

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

2 participants