daig / daig/intrinsic-superclasses

Weaken superclass requirements

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Haskell
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

currently if we write

`[instances | Foo f => Bar (Baz f) where ...|]`

then all the methods will have the required context `Foo f`, even if that particular superclass does not require `Foo`, making our instances hold in less places than they should. This is remedied by manually adding a superclass instances with the correct context before `instances`, but in the worst case every superclass has a weaker context than the subclass so `instances` is useless.

We'd like to automatically weaken the context for each superclass based on the actual constraints on the default methods. This is likely to be tricky and possibly require implementing type inference.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.