Should only match on equality because it seems like I need some magic equality. But it occurs to me the types that can pattern match are already the kinds that often have deep equality.
Generic tuples wouldn't work as in this case but if the things being matched were data all the way down it could work.
That said given that it fails on generics maybe that's the argument not to do it unless we could restrict the generic to being a Data kind, which I have thought about before.
I've resisted saying that:
Should only match on equality because it seems like I need some magic equality. But it occurs to me the types that can pattern match are already the kinds that often have deep equality.
Generic tuples wouldn't work as in this case but if the things being matched were data all the way down it could work.
That said given that it fails on generics maybe that's the argument not to do it unless we could restrict the generic to being a Data kind, which I have thought about before.