
5 Dec
2017
5 Dec
'17
10:47 a.m.
Hello, All! I have type: infixr 9 ||| data a ||| b = A a|B b deriving (Eq, Data, Show) and usually I wraps into it values which are instances of my class IsTag: class IsTag a where anyTag :: a So, I need to check if some value wrapping by `a|||b` is equal to `anyTag`, i.e.: A (B (A x)) == (anyTag::TypeOf_x) ==> True This function must be generic, ie, it can not know anything about concreate TypeOf_x, only: `a|||b` and `IsTag`. How to do it??? I added `Data` to `a|||b` and even to values which I "wrap" with `a|||b` (I assumed to use `gmap*` and Co), but this does not help me. Is it even possible?? == Best regadrs, Paul