view package:row-types

A convenient function for using view patterns when dispatching variants. For example:
myShow :: Var ("y" '::= String :| "x" '::= Int :| Empty) -> String
myShow (view x -> Just n) = "Int of "++show n
myShow (view y -> Just s) = "String of "++s