
11 Dec
2017
11 Dec
'17
6:04 a.m.
Hello All! I have function which constructs some data type. It has signature `Name -> Q [Dec]`. Somewhere in its body I'm extracting constructors of some type with pattern-matching: case tyCons of DataD ctx nm tyVars mbKind cs derivs -> ... Type of those constructors `cs` instantiates some class like this: class MyClass a where specialValue :: a So, I'm iterating over those `cs` but I want to skip one of them which is equal to `specialValue`. Something like this: [c | c <- cs, c /= specialValue] How to do this with Template Haskell's `Con` type (`c`::Con) - I can't call it to compare created value with a `specialValue` ? === Best regards, Paul