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

funSubst works for all applications #1243

Merged
merged 1 commit into from
Mar 24, 2020
Merged

funSubst works for all applications #1243

merged 1 commit into from
Mar 24, 2020

Conversation

christiaanb
Copy link
Member

Before, funSubst, the heart of our type-family resolution engine, could only deal with a -> b and F a b on both the matching side and argument side. Now it works on all applications, including things of the form f a.

Fixes #1242

Copy link
Member

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better than before and I'm convinced this properly solves #1242.

I'm worried about the computational complexity of this function though. Due to the list for substitutions and the lookup for every variable, this works out to be O(n²). Then again, I guess we can assume these lists always stay tiny so the constant overhead of a hashmap might not be worth it. Nevertheless, something to keep in mind.

clash-lib/src/Clash/Core/Type.hs Outdated Show resolved Hide resolved
@martijnbastiaan
Copy link
Member

Almost forgot: add a CHANGELOG entry.

Before, `funSubst`, the heart of our type-family resolution
engine, could only deal with `a -> b` and `F a b` on both the
matching side and argument side. Now it works on all applications,
including things of the form `f a`.

Fixes #1242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synthesising BitPack instances for type with phantom parameter fails
2 participants