
25 Jul
2011
25 Jul
'11
6:14 p.m.
On 26 July 2011 04:30, bob zhang
Hi, all, newtype Stream a = Stream [a]
I wanna derive ListLike [a] a automatically, but did not find a solution, I tried deriving instance ListLile (Stream a) a -- does not work
You can only derive certain in-built classes (Eq, Ord, Show, etc.) and - with extensions - some other classes (e.g. Functor). You _cannot_ derive ListLike. That said, it may be possible to extend either derive [1] or DrIFT [2] to be able to generate these instances for you. [1]: http://hackage.haskell.org/package/derive [2]: http://hackage.haskell.org/package/DrIFT-cabalized -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com