[Haskell-cafe] Non-exhaustive pattern match warning (incorrect?)

Michael Orlitzky michael at orlitzky.com
Mon Dec 26 22:57:21 CET 2011


On 12/26/2011 03:17 PM, Antoine Latter wrote:
>
> The error is warning you that the record update 'oct { b8 = bit }' can
> fail at run-time if 'oct' is None.
>
> Since it looks like you've checked for that you shouldn't have a
> problem, but the compiler doesn't know that.

Thanks, that's what I thought but I wanted to make sure I wasn't missing 
something obvious.


> If you decompose your type into 'Octet' without the 'None' case, and
> 'Maybe Octet' for the times when 'None' is appropriate, the compiler
> will have enough information to not give warnings like this.
>
> I can't be the one to tell you if that is worth it or not.

I must have had a good reason to do it that way, right? =)



More information about the Haskell-Cafe mailing list