Skip to content

Support type kinds #27

@fierce-katie

Description

@fierce-katie

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions