`case` statements in elm can not match variables.  Both of these branches
look to the compiler as if they match everything.  It interprets
`messageParam` as the name of a variable to which to bind the match, which
in this case will be `node.message`.

On Sun, Jul 9, 2017 at 5:04 PM jadski <jonathan@hotlink.technology> wrote:

> With manual formatting
>
> *Code*
>
> type Message = Good | Bad | ManyOthers
>
> type alias Node = { message : Message }
>
> trymatch : Node -> Message -> Bool
> trymatch node messageParam =
>     case node.message of
>         messageParam ->
>             True
>         _ ->
>             False
>
> evalTrue = trymatch { message = Good } Good
> evalFalse = trymatch { message = Good } Bad
>
>
> *Error Message*
>
> The following pattern is redundant. Remove it.
>
> 10|         _ ->
>             ^
> Any value with this shape will be handled by a previous pattern.
>
>
>
> --
> 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 elm-discuss+unsubscr...@googlegroups.com.
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to