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
I have a newtype:
When I try to call
mkSumType $ Proxy @(Foo A B), I get an expected error that type kinds mismatch forA. When I try smth likemkSumType $ Proxy @(Foo "id" A), it compiles and generates PureScript code like this: