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

Normalization doesn't work #5

Open
vadimsemenov opened this issue Apr 1, 2018 · 0 comments
Open

Normalization doesn't work #5

vadimsemenov opened this issue Apr 1, 2018 · 0 comments

Comments

@vadimsemenov
Copy link

$ normalize
(\a.\x.a) x
\x'.x
$ normalize
(\a.\x.\x.a) x
normalize: src/Simple/Reduction.hs:82:5-70: Irrefutable pattern failed for pattern Right newExpr

At first sight the problem is in rename' function:

rename' act dict (Lambda var expr)
        | Map.member var dict = Lambda newVar $ rename' (Map.insert var newVar act) (Map.delete var dict) expr
        | Map.member var act  = Lambda var    $ rename' (Map.delete var act)        dict                  expr
        | otherwise           = Lambda var    $ rename' act                         dict                  expr

Seems, you should not delete bound variable from dict, or should replace it with actual value on second stage of the pattern matching above.

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