Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upList.sortWith given invalid order function causes compiler to hang #852
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Apr 8, 2017
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.
process-bot
commented
Apr 8, 2017
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jul 10, 2017
Member
This is "infinite types can hang rather than give a nice error" problem. The upcoming error is like this:
-- INFINITE TYPE ------------------ /Users/evan/Documents/pkgs/core/src/List.elm
I am inferring a weird self-referential type for the 1st argument to function
`sortWith`:
57| sortWith (Tuple.second >> (>)) [("a",4),("d",7),("b",6)]
^^^^^^^^^^^^^^^^^^^
Here is my best effort at writing down the type. You will see ∞ for parts of the
type that repeat something already printed out infinitely.
( comparable, ∞ ) -> ( comparable, ∞ ) -> Order
Usually staring at the type is not so helpful in these cases, so definitely read
the debugging hints for ideas on how to figure this out:
<https://github.com/elm-lang/elm-compiler/blob/0.19.0/hints/infinite-type.md>
Probably could be improved, but that is for https://github.com/elm-lang/error-message-catalog
|
This is "infinite types can hang rather than give a nice error" problem. The upcoming error is like this:
Probably could be improved, but that is for https://github.com/elm-lang/error-message-catalog |
mordrax commentedApr 8, 2017
•
edited
Edited 1 time
-
mordrax
edited Apr 8, 2017 (most recent)
causes my 0.18 compiler to hang, cpu and memory goes through the roof.
I fixed this by realising that the order function is completely wrong and that I should have gone with
However, the usually friendly compiler got very confused and never returned.