Generalised pattern matching on a Sigma type using a Pi type to
describe how to handle each case.
This is a specialisation of
matchCases for
f =
Identity. We could also have also given it the following type:
matchPure :: Sigma t -> (t ~> Case Identity a) -> a
We chose to simplify it by inlining
~>,
Case and
Identity.