jonathanGfischoff | 18 Jan 2010 00:42
Picon

Querying the instances a data type implements

Hi,

I am trying query the instances that a data type implements. Calling reify on the data type doesn't appear to return anything relating to type classes.

I am very new to Template Haskell, so I apologize if there is a easy way to do this that I missed.

-Jonathan

_______________________________________________
template-haskell mailing list
template-haskell <at> haskell.org
http://www.haskell.org/mailman/listinfo/template-haskell
Robert Greayer | 18 Jan 2010 01:56
Picon

Re: Querying the instances a data type implements

On Sun, Jan 17, 2010 at 6:42 PM,  <jonathanGfischoff <at> gmail.com> wrote:
> Hi,
>
> I am trying query the instances that a data type implements. Calling reify
> on the data type doesn't appear to return anything relating to type classes.
>
> I am very new to Template Haskell, so I apologize if there is a easy way to
> do this that I missed.
>
> -Jonathan

I do not believe that this is possible (getting instances based on
type).  It, I suppose, would be possible theoretically to get at least
instances in-scope, but, as type classes are open, this wouldn't,
necessarily, be all type classes the date type implements.  But I
don't believe there's any support for navigating to instances from
types.

As an aside, you'd be better off sending queries about Template
Haskell to the haskell-cafe <at> haskell.org mailing list, as this (TH)
mailing list is very lightly used and there's been talk of getting rid
of it.  Probably anybody subscribed to this list is also subscribed to
Haskell Cafe as well.
Simon Peyton-Jones | 18 Jan 2010 10:55
Picon
Favicon
Gravatar

RE: Querying the instances a data type implements

All: as Robert says, I keep meaning to close the template-haskell list altogether; but I am not sure how to do so. 

 

Jonathan: where did you find a pointer to the mailing list?  I should remove those too.

 

Returning to the question, sadly there’s no way to do what you want right now.  There’s an open feature request:

 http://hackage.haskell.org/trac/ghc/ticket/1835

Would anyone like to undertake it?  It’s not hard.

 

Simon

 

From: template-haskell-bounces <at> haskell.org [mailto:template-haskell-bounces <at> haskell.org] On Behalf Of jonathanGfischoff <at> gmail.com
Sent: 17 January 2010 23:42
To: template-haskell <at> haskell.org
Subject: [Template-haskell] Querying the instances a data type implements

 

Hi,

I am trying query the instances that a data type implements. Calling reify on the data type doesn't appear to return anything relating to type classes.

I am very new to Template Haskell, so I apologize if there is a easy way to do this that I missed.

-Jonathan

_______________________________________________
template-haskell mailing list
template-haskell <at> haskell.org
http://www.haskell.org/mailman/listinfo/template-haskell
Jonathan Fischoff | 19 Jan 2010 22:37
Picon

Re: Querying the instances a data type implements

I got the link from the Template Haskell Wiki page. 


It is possible that I might have time to work on the feature myself. I don't it, but if that is the case I will let you know.

-Jonathan

On Mon, Jan 18, 2010 at 1:55 AM, Simon Peyton-Jones <simonpj <at> microsoft.com> wrote:

All: as Robert says, I keep meaning to close the template-haskell list altogether; but I am not sure how to do so. 

 

Jonathan: where did you find a pointer to the mailing list?  I should remove those too.

 

Returning to the question, sadly there’s no way to do what you want right now.  There’s an open feature request:

 http://hackage.haskell.org/trac/ghc/ticket/1835

Would anyone like to undertake it?  It’s not hard.

 

Simon

 

From: template-haskell-bounces <at> haskell.org [mailto:template-haskell-bounces <at> haskell.org] On Behalf Of jonathanGfischoff <at> gmail.com
Sent: 17 January 2010 23:42
To: template-haskell <at> haskell.org
Subject: [Template-haskell] Querying the instances a data type implements

 

Hi,

I am trying query the instances that a data type implements. Calling reify on the data type doesn't appear to return anything relating to type classes.

I am very new to Template Haskell, so I apologize if there is a easy way to do this that I missed.

-Jonathan


_______________________________________________
template-haskell mailing list
template-haskell <at> haskell.org
http://www.haskell.org/mailman/listinfo/template-haskell

Gmane