Similar code, with new cases enforced by the compiler

haveSameConstructor : Bla -> Bla -> Bool
haveSameConstructor first second =
    case (first, second) of
        (A _, A _) -> True
        (B _, B _) -> True
        (A _, _) -> False
        (B _, _) -> False

On Jul 17, 2017 3:34 AM, "Birowsky" <[email protected]> wrote:

> That's not so bad. But the compiler wouldn't be able to nudge me to add a
> new comparison when I add a new constructor in the Bla union.
>
> Thanx anyways.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to