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

error "Could not match kind # Type with kind Type" when using ( | r ) with RowApply #3775

Open
srghma opened this issue Jan 24, 2020 · 2 comments

Comments

@srghma
Copy link
Contributor

srghma commented Jan 24, 2020

for example I can write

type The1 r = ( x :: String | r )
type The2 r = ( y :: String | r )

type MyRec = { | The1 + The2 + () }

but when I need The2 empty and write

type The1 r = ( x :: String | r )
type The2 r = ( | r )

type MyRec = { | The1 + The2 + () }

it throws error

  Could not match kind

    # Type

  with kind

    Type


while checking the kind of Record (RowApply The1 (RowApply The2 ()))
in type synonym MyRec
@JordanMartinez
Copy link
Contributor

I'm pretty sure the ( | r) syntax only works when there are "concrete" rows between the ( and |. Otherwise, The2 is better defined as type The2 r = r.

@natefaubion
Copy link
Contributor

@JordanMartinez is correct, due to a quirk in the Type AST there is no distinction between r and ( | r ) so it will default to Type. With PolyKinds, The2 will have a polymorphic signature (type The2 :: forall a. a -> a) so it will work in a future release.

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

3 participants