[Haskell-beginners] help designing types for a gsl fit

Francesco Ariis fa-ml at ariis.it
Fri Jun 2 17:30:39 UTC 2017


On Fri, Jun 02, 2017 at 06:04:44AM +0000, PICCA Frederic-Emmanuel wrote:
> Now I want this to work also with C
> 
> C -> [a1..., an] ++ [b1, .... bm]
> 
> So the C instance is juste the (toGsl a) ++ (toGsl b)
> 
> Is there a way to write this generically for other type  construct like
> (data D = D C A) etc....

Hello Frederic,
    maye Generic programming [1] is what you need?

[1] https://wiki.haskell.org/Generics

> 2) the fromGsl case

2) is more tricky to me. How do I decide where to split? Feels like
parsing data.


More information about the Beginners mailing list