Lets say we have this type declaration:
data D a = A a | B a | C a | D a | E a | F a
and want to define a function over it which divides the data constructors in 2 sets. It would be nice to write something like that:
g x | x `is` [A,B,C] = 1
| x `is` [D,E,F] = 2
instead of matching on each constructor separately.
Is there any way to achieve this? I looked at uniplate but couldn't find a way to do it.