Re: Is there a way to make this code compose generic ?

PICCA Frederic-Emmanuel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <1951469514.95120075.1744209709200.JavaMail.zimbra@synchrotron-soleil.fr>
Another question related to this one

> data ExampleData

> instance DataSource ExampleData where
>   data DataSourceT k ExampleData = DataSource'ExampleData
>     (DataSourceT k BaseData)
>     (DataSourceT k BaseData)
>     (DataSourceT k BaseData)
>     (DataSourceT k BaseData)
>     (DataSourceT k BaseData)
>     deriving Generic
>   ds'Shape = generic'ds'Shape
>   withDataSourceP = generic'withDataSourceP
> 

Do you think that it is possible to derive the

DataSourceT Acq and Path from the ExampleData type


data ExampleData = ExampleData A B

it seems mechanical to me

data DataSourceT k ExampleDAta
  = DataSource'ExampleData
    (DataSourceT k A)
    (DataSourceT k B)

I tryed with HKD like this

-- "Higher-Kinded Data"                                                                                                                    
type family HKD f a where
  HKD Identity a = a
  HKD f        a = f a         

data ExampleData' f
  = ExampleData
   (HKD f A)
   (HKD f B)

where

but then I do not know howto define the type family for DataSourceT with this ExampleData' f

Cheers

Fred
_______________________________________________
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.