How to get list of instances of a given class?
Bulat kindly pointed me to the SerTH example. I also have been trying to browse the GHC documentation trying to find the answer to my quesitons. I see, for example, what can be gotten for a class (provided that the name of the class is known): data Dec ... ClassD Cxt String [String] [Dec] -- or ClassD Cxt Name [Name] [FunDep] [Dec] in --6.4.x InstanceD Cxt Type [Dec] ... The documentation (neither for 6.2.2 nor for the latest) says nothing about what is in [Dec] for a class. Are instances of the class known at the moment of slplicing contained there? I may be asking too common questions. I just need to see whether my task is accomplishable via TH. If it is not, then I'll do this via some plugins to HSFFIG, but the latter is not much desirable. Please advise. Thanks. -- Dimitry Golubovsky Anywhere on the Web
Hello Dimitry, Tuesday, December 13, 2005, 5:37:49 PM, you wrote: DG> The documentation (neither for 6.2.2 nor for the latest) says nothing DG> about what is in [Dec] for a class. Are instances of the class known DG> at the moment of slplicing contained there? yopu must read not documentation, but the sources of following modules import Language.Haskell.TH.Syntax import Language.Haskell.TH.Lib import Language.Haskell.TH.Ppr it is the only way now to create any TH program :) -- Best regards, Bulat mailto:bulatz@HotPOP.com
participants (2)
-
Bulat Ziganshin -
Dimitry Golubovsky