Datakind and instance

PICCA Frederic-Emmanuel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <955678727.55296196.1718292774043.JavaMail.zimbra@synchrotron-soleil.fr>
Hello,

I have a class

class HasIniConfig where
   getConfig ...

a kind using DataKind

data ProjectionType = TypeA
                    | TypeB
                    ...

I would like to create instance for each 'TypeX

But when I try to write an instance

I get this error

src/Hkl/Binoculars/Projections/QCustom.hs:195:23: error:
    • Expected a type, but
      ‘'QCustomProjection’ has kind
      ‘ProjectionType’
    • In the first argument of ‘HasIniConfig’, namely
        ‘'QCustomProjection’
      In the instance declaration for ‘HasIniConfig 'QCustomProjection’
    |
195 | instance HasIniConfig 'QCustomProjection where
    |                       ^^^^^^^^^^^^^^^^^^


I should add class HasIniConfig (a :: ProjectionType) where

But in that cas I can not  create instance for other type, and I need to :)

I would be glade if someone could explain how to all this.

Thanks

Frederic
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.