[Haskell-cafe] Ensuring all values of an ADT are explicitly handled OR finding all occurrences of type X in my app

Saurabh Nanda saurabhnanda at gmail.com
Tue Jan 31 02:47:44 UTC 2017


If I have the following ADT

data BookingState = Confirmed | Cancelled

which had a very high chance of being expanded in the future to have more
values. How do I ensure that every pattern match on BookingState matches
each value explicitly. Basically prevent the '_' matcher ?

If that is not possible, is the following possible instead: evolve
BookingState and then find all possible occurrences of values of
BookingState throughout my app?

I'm basically trying to make sure that any a newly added state, which may
require special-case handling is not automatically handled by the '_'

-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170131/4006fc76/attachment.html>

More information about the Haskell-Cafe mailing list