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

Do subtyping. #165

Closed
MarisaKirisame opened this issue Mar 26, 2017 · 4 comments
Closed

Do subtyping. #165

MarisaKirisame opened this issue Mar 26, 2017 · 4 comments
Assignees
Labels

Comments

@MarisaKirisame
Copy link
Contributor

MarisaKirisame commented Mar 26, 2017

Why: DBI (Term DBI) should entail DBI (Term Lang)
so need some subtyping crtieria.

But Why Term? Dynamic Eval. If a Term need to be diff and evaled under different context, simply use Comp that return pair of different repr

How? Generic Solver returning constraint list, search through it by only climbing the class hierarchy, using a list to keep track of all alternative.
Cannot solve instance of unknown <: C => unknown <: D, when C is subtype of D, though, but can always be resolved when in the concrete registeration.
Also need registering and is a bit slow, a bit hard to write.
Maybe manually saving instance with overlapping instance/incoherent instance would help.

Other solution: specialize into sub. Do not have such problem but create ton of similar Class. Also need to manually impl subtyping hierarchy registration for each new type.
Could probably use Template Haskell to help ths.

@MarisaKirisame MarisaKirisame self-assigned this Mar 26, 2017
@MarisaKirisame
Copy link
Contributor Author

Just checked. We can manually cache by declaring exact overlapping instance. Toobad GHC cant memorized for us.

Zeroth solution seems to be saner.

@MarisaKirisame
Copy link
Contributor Author

Cannot redo xor without Term. @dramforever
I will hack it, stick to lang for now, and do subtyping later. Wanna give it a shot?

@MarisaKirisame
Copy link
Contributor Author

I think I can fix it by generalizing over weight...

@MarisaKirisame
Copy link
Contributor Author

fixed by 06d36cb

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

No branches or pull requests

1 participant