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

Can we: replace Member p ps with a type-family? #56

Open
ShapeOfMatter opened this issue Sep 27, 2024 · 1 comment
Open

Can we: replace Member p ps with a type-family? #56

ShapeOfMatter opened this issue Sep 27, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@ShapeOfMatter
Copy link
Owner

No description provided.

@ShapeOfMatter
Copy link
Owner Author

Quoting @gshen42 from Zulip:

Let me be a bit more clear, there might be a way to do that , but I suspect it will be long-winded and painful. The short reason for this in Haskell is that the type-constraints system doesn't do backtracking. For example, let's say we want to prove Member l ls, it can be proved either directly by rules of Member or transitively through Subset and Member. Without backtracking, GHC will blindly pick one and if it fails then the whole resolution fails — it doesn't remember the other option and try that.

There're good reasons why GHC impose these restrictions: they want resolution to be coherent and decidable, and it's never ment to be a full-blown logic programming language.

One way around this is using a GHC plugin and write our own constraint solver. This is what I mean "long-winded and painful".

@ShapeOfMatter ShapeOfMatter added the wontfix This will not be worked on label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant