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

SubListProof & ElemProof can be marked injective #1

Open
Icelandjack opened this issue Aug 28, 2017 · 1 comment
Open

SubListProof & ElemProof can be marked injective #1

Icelandjack opened this issue Aug 28, 2017 · 1 comment

Comments

@Icelandjack
Copy link

Moved from thesis

Type families SubListProof and ElemProof can be made injective, does that help anywhere?

type family
  SubListProof = (res :: SubList (xs :: [a]) (ys :: [a])) | res -> xs a where
  SubListProof = SubNil
  SubListProof = Keep SubListProof
  SubListProof = Drop SubListProof

type family
  ElemProof = (res :: EffElem eff a xs) | res -> eff a xs where
  ElemProof = Here
  ElemProof = There ElemProof
@goldfirere
Copy link
Owner

These are interesting sorts of injectivity annotations, in that both are fully implied simply by the kind of the result. Note that the injective arguments are all mentioned in the kind of the result. Naturally, a type's identity implies its kind's identity. Does the injectivity annotation change inference? I would doubt it, but I can't say for sure.

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

No branches or pull requests

2 participants