You could write something like:

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

On Sun, Jul 16, 2017 at 6:33 PM Birowsky <[email protected]> wrote:

> Given:
>
> type Bla = A Int | B Int
> valA1 = A 1
> valA2 = A 2
>
>
> Is there a way for me to check whether `valA1` has been constructed with
> the constructor of `valA2`?
>
> --
> 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