Re: [Haskell-cafe] Introspection on types.

2009-10-01 Thread Gregory Propf
Thanks, I'll check out Data and Typeable --- On Thu, 10/1/09, Brandon S. Allbery KF8NH wrote: From: Brandon S. Allbery KF8NH Subject: Re: [Haskell-cafe] Introspection on types. To: "Gregory Propf" Cc: "Brandon S. Allbery KF8NH" , "Haskell-Cafe" Date: Thu

Re: [Haskell-cafe] Introspection on types.

2009-10-01 Thread Brandon S. Allbery KF8NH
On Oct 1, 2009, at 19:22 , Gregory Propf wrote: Is there a way to tell, let's say, how many constructors there are for a type? Or do I need one of the haskell extensions I've read about? If the constructors are nullary (that is: data MyData = Foo | Bar | Baz) you could derive Enum and B

Re: [Haskell-cafe] Introspection on types.

2009-10-01 Thread Derek Elkins
On Thu, Oct 1, 2009 at 6:22 PM, Gregory Propf wrote: > > Is there a way to tell, let's say, how many constructors there are for a > type?  Or do I need one of the haskell extensions I've read about? Use Data.Data and derive Data for the types you are interested in or instance it for pre-existing

[Haskell-cafe] Introspection on types.

2009-10-01 Thread Gregory Propf
Is there a way to tell, let's say, how many constructors there are for a type?  Or do I need one of the haskell extensions I've read about? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-ca