Closed yormi closed 7 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
Equality in Elm on functions only "works" when dealing with referential equality.
Because of eager evaluation, you end up with the same event handler in the case where your html-producing takes no arguments. Similarly, if the event mapping function is simply A
, it's referentially equal to another A
. By having a parameter on your html-producing function - even if you actually ignore it - evaluation doesn't happen until all arguments are passed, so you'll end up with two separate (\s -> A s)
functions that are not referentially equal.
Note that this is not a virtual-dom issue and expected behaviour.
Let's continue trying to find a way for your use-case to be supported through the issue you logged on elm-html-test
.
Hi fellows,
I'm trying to solve this problem and I'm wondering if you can help me: https://github.com/eeue56/elm-html-test/issues/37
I think it is related to this issue as well: https://github.com/elm-lang/virtual-dom/issues/13
Here's the test that I need to make pass with elm 0.18. Right now, it throws:
Points to note:
(\s -> A s)
byA
it worksunused
parameter tosomeHtml
, no problems.Html.lazy someHtml "a"
) then there's no error but the test still fails.Questions
Any help would be appreciated :)