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

Support type kinds #27

Open
fierce-katie opened this issue Jun 20, 2017 · 1 comment
Open

Support type kinds #27

fierce-katie opened this issue Jun 20, 2017 · 1 comment

Comments

@fierce-katie
Copy link

fierce-katie commented Jun 20, 2017

I have a newtype:

newtype Foo (name :: Symbol) a = Foo { unwrapFoo :: a } deriving (Generic, ...)

When I try to call mkSumType $ Proxy @(Foo A B), I get an expected error that type kinds mismatch for A. When I try smth like mkSumType $ Proxy @(Foo "id" A), it compiles and generates PureScript code like this:

newtype Foo "id" a =
    Foo {
      unwrapFoo :: a
    }

derive instance genericFoo :: Generic a => Generic (Foo "id" a)

--------------------------------------------------------------------------------
_Foo :: forall "id" a. Prism' (Foo "id" a) { unwrapFoo :: a}
_Foo = prism' Foo f
  where
    f (Foo r) = Just r
@eskimor
Copy link
Owner

eskimor commented Jun 21, 2017

are type kinds already supported by the PureScript compiler?! If so one needs to check whether GHC generics can deal with this, then it should not be hard to implement this. PRs welcome!

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

No branches or pull requests

2 participants