On 26 July 2011 04:30, bob zhang <bobzhang1...@gmail.com> wrote: > 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.miljeno...@gmail.com IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe