You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem seems to be that _Utils_eqHelp assumes both its arguments are of the same type/shape. In general that’s true in Elm, but not for Json.Decode.Value. It’s a wrapper around any value, which might not be the same on both sides.
SSCCE
The above examples fail because the value on the right side of
==
isundefined
.Here’s an Ellie by @mpizenberg: https://ellie-app.com/cLXHgSHm8yTa1
Notes
The problem seems to be that
_Utils_eqHelp
assumes both its arguments are of the same type/shape. In general that’s true in Elm, but not forJson.Decode.Value
. It’s a wrapper around any value, which might not be the same on both sides.Edit: This Discourse post by Evan explains that
(==)
shouldn’t be used with JSON values from elm/json and an idea for improving this in the future: https://discourse.elm-lang.org/t/function-equality/7538/24Edit 2: Apparently this is even documented! 🤦 https://package.elm-lang.org/packages/elm/core/latest/Basics#equality
Though these crash for a different reason (“the implementation is not at all made for
Json.Decode.Value
”) than mentioned in those docs.The text was updated successfully, but these errors were encountered: