Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-11-07 Thread Dmitry Olshansky
For TH look also at http://www.mail-archive.com/haskell-cafe@haskell.org/msg13057.html 2011/10/27 Magicloud Magiclouds > On Thu, Oct 27, 2011 at 1:57 AM, Brent Yorgey > wrote: > > On Wed, Oct 26, 2011 at 09:10:23PM +0400, MigMit wrote: > >> Can't be done. Even if this particular module doesn't

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Magicloud Magiclouds
On Thu, Oct 27, 2011 at 1:57 AM, Brent Yorgey wrote: > On Wed, Oct 26, 2011 at 09:10:23PM +0400, MigMit wrote: >> Can't be done. Even if this particular module doesn't contain >> "instance Class Type", it's quite possible that the said instance >> would be defined in another module, about which th

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Magicloud Magiclouds
On Thu, Oct 27, 2011 at 7:04 AM, Evan Laforge wrote: >> No, this lists all the instances of a class.  OP asked for the classes >> of which a given type is an instace. >> >> Presumably it is possible, since Haddock does it!  In the >> documentation generated for a type it lists classes of which the

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Evan Laforge
> No, this lists all the instances of a class.  OP asked for the classes > of which a given type is an instace. > > Presumably it is possible, since Haddock does it!  In the > documentation generated for a type it lists classes of which the type > is an instance.  So you might want to look at how H

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Brent Yorgey
On Wed, Oct 26, 2011 at 09:10:23PM +0400, MigMit wrote: > Can't be done. Even if this particular module doesn't contain > "instance Class Type", it's quite possible that the said instance > would be defined in another module, about which this one knows > nothing about. That doesn't mean it can't b

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Brent Yorgey
On Wed, Oct 26, 2011 at 09:15:41AM -0700, Nathan Howell wrote: > On Wed, Oct 26, 2011 at 6:53 AM, Magicloud Magiclouds < > magicloud.magiclo...@gmail.com> wrote: > > > But in Haskell, could I write a code to list the classes that a type > > instanced? > > TemplateHaskell as well. > > > > It's p

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread MigMit
Can't be done. Even if this particular module doesn't contain "instance Class Type", it's quite possible that the said instance would be defined in another module, about which this one knows nothing about. On the other hand, what would you do with that information? Отправлено с iPad 26.10.2011

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Nathan Howell
On Wed, Oct 26, 2011 at 6:53 AM, Magicloud Magiclouds < magicloud.magiclo...@gmail.com> wrote: > But in Haskell, could I write a code to list the classes that a type > instanced? > TemplateHaskell as well. > It's possible with TemplateHaskell. Look at classInstances and the ClassI data construc

Re: [Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Ertugrul Soeylemez
Magicloud Magiclouds wrote: > If this was in ruby or other languages that support reflection, it > won't be a question. > But in Haskell, could I write a code to list the classes that a type > instanced? In regular Haskell, type information is completely lost after compilation, so you can't

[Haskell-cafe] Is it possible to get the information of instances of a type?

2011-10-26 Thread Magicloud Magiclouds
Hi, If this was in ruby or other languages that support reflection, it won't be a question. But in Haskell, could I write a code to list the classes that a type instanced? TemplateHaskell as well. -- 竹密岂妨流水过 山高哪阻野云飞 ___ Haskell-Cafe mailing list H