We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If a function let binding is always called with the same argument, specialise it to that.
The text was updated successfully, but these errors were encountered:
To expand on this, the idea is that if we have
let f = \x y z. foo x y z in bar (f a 1 b) (f c 1 d)
then we can specialise fs y parameter and get:
f
y
let f = \x z. foo x 1 z in bar (f a b) (f c d)
This can help e.g. if a let binding has its type generalised and is then used repeatedly with the same typeclass dictionary.
Some care has to be taken with termination, to not turn a lambda into something that is potentially non-terminating.
This might be a good issue to look at for someone who wants to dive into the compiler internals, since the scope of it is limited.
Sorry, something went wrong.
No branches or pull requests
If a function let binding is always called with the same argument, specialise it to that.
The text was updated successfully, but these errors were encountered: