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

Any way to iterate the rules? #72

Open
ulysses4ever opened this issue Aug 29, 2024 · 2 comments
Open

Any way to iterate the rules? #72

ulysses4ever opened this issue Aug 29, 2024 · 2 comments

Comments

@ulysses4ever
Copy link

Example:

❯ cat ./Example.hs
module Example where

(?) :: a -> b -> a
(?) a _b = a

test :: Int
test = 42 ? undefined ? 5

I run:

❯ retrie --adhoc 'forall a b. a ? b = a'
...
Done! 1 lines changed.

And get:

❯ cat ./Example.hs
module Example where

(?) :: a -> b -> a
(?) a _b = a

test :: Int
test = 42 ? undefined

I expected to get test = 42 on the last line. Is it possible to achieve this currently or would it be hard to add such behavior?

A workaround would be to call retrie in a shell loop, perhaps. This doesn't sound entertaining, and on a larger codebase will take time.

@ulysses4ever
Copy link
Author

Update: I just found out that there's the -i flag that allows you to iterate the specified number of times. It'd be great if there's an option to iterate till fixpoint, assuming it exists, which is a valid assumption in many practical cases (therwise the user can always kill the process).

@watashi
Copy link
Contributor

watashi commented Aug 29, 2024

It'd be great if there's an option to iterate till fixpoint

Retrie will avoid unnecessary iterations if it hits a fixed point.
How about just use -i 1000 or a large enough number?

therwise the user can always kill the process

For a large repo, running retrie itself can take a long time, sometimes, it's not as obvious if it's just slow or get stuck because of this.

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