[Haskell-cafe] Getting list of constructors of a Type

AntC anthony_clayden at clear.net.nz
Wed Jun 4 05:33:43 UTC 2014


> Alejandro Serrano Mena <trupill <at> gmail.com> writes:
> 
> Dear Haskell-Café,As part of my Google Summer of Code, I need to get the 
list of data constructors of a certain data type on a specific scenario.

Hi Alejandro, have you considered Data/Typeable or Generics?

I'm not quite sure what you're looking for,
but see my (similar?) requests:
http://www.haskell.org/pipermail/haskell-cafe/2013-October/111133.html
http://www.haskell.org/pipermail/generics/2013-December/000549.html
And the helpful replies.

Beware re Nils' suggestion that I think TH has changed with GHC7.8 such that 
type inspection at compile time is not so easy.
(Sorry to be vague, and others will no doubt correct me.)


AntC



More information about the Haskell-Cafe mailing list