High Kind for foreign import data

Hi,

Snippet

import Effect (Effect)
data Effect2Effect :: Effect -> Effect
foreign import data R ∷ Effect2Effect

produces error:

[1/1 OrphanKindDeclaration] src/ECharts/Types/Phantom.purs:8:1

  8  data Effect2Effect :: Effect -> Effect
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  The kind declaration for Effect2Effect should be followed by its definition.

Hi,

can you tell us a bit more what you are trying to achieve here?
I guess you realized that Effect needs a type-parameter to be a type (it’s kind is Type -> Type) so Effect -> Effect would mean something like (Type -> Type) -> (Type -> Type) so this would type-check:

foreign import data R :: (Type -> Type) -> (Type -> Type)

but I don’t think this is what you want is it?

And do you indent Effect2Effect to be a kind-synonym? To be honest I don’t know if PureScript supports something like that (I think not but I can be wrong here)

Thanks, I got the snippet after transformation of echart code for new PureScript:

I haven’t solved the type puzzle, but it turned out that binding works without Phantom module and type parameter in DSL!