
18 May
2015
18 May
'15
7:20 p.m.
Can I use either template Haskell, GHC Generics, or something else to get the list of Constructors in Codes? Then I could do `map show codeSumTypeMembers` and get `["A0100A","A0500A"]`? Here's an example of solving this problem manually: data Codes = A0100A | A0500A deriving Show codeExists "A0100A" = True codeExists "A0500A" = True codeExists _ = False main = print $ codeExists xmlElementName where xmlElementName = "A0500A" -- λ> main -- True