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

Kind unification bug #3077

Open
kcsongor opened this issue Sep 16, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@kcsongor
Copy link
Contributor

commented Sep 16, 2017

As discussed on slack, there seems to be an issue with how kinds are unified, here's a minimal, self-contained example:

data TProxy (t :: Type) = TProxy
data SProxy (s :: Symbol) = SProxy

put :: forall proxy a. proxy a -> TProxy a
put _ = TProxy

--wrong :: TProxy "apple"
wrong = put (SProxy :: SProxy "apple")

This typechecks (on both HEAD and 0.11.6), and we managed to force a Symbol into TProxy.

@paf31 paf31 added the bug label Sep 18, 2017

@paf31 paf31 added this to the 0.12.0 milestone Sep 18, 2017

@paf31

This comment has been minimized.

Copy link
Member

commented Sep 18, 2017

I think the problem here is that only the kinds of written types are checked. The only incorrect type is the type of wrong, which isn't checked.

@paf31

This comment has been minimized.

Copy link
Member

commented Oct 2, 2017

I made a quick attempt to fix this, but it's a bit trickier than I thought. I think it actually needs some of the same changes that we would need for polykinds, namely adding kind information to the types of values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.