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

Michael Orlitzky michael at orlitzky.com
Tue Jan 31 04:19:57 UTC 2017


On 01/30/2017 09:47 PM, Saurabh Nanda wrote:
> Hi,
> 
> 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 ?
> 

Don't write the "_" case? GHC will warn you about any pattern matches
you've missed.



More information about the Haskell-Cafe mailing list