Created
August 31, 2017 03:27
-
-
Save jtomchak/f17ca7589b877a483be60df4398b478d to your computer and use it in GitHub Desktop.
Elm Compiler when trying to append to a new list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The 1st argument to function `append` is causing a mismatch. | |
5| List.append "black" fishes | |
^^^^^^^ | |
Function `append` is expecting the 1st argument to be: | |
List a | |
But it is: | |
String | |
> moreFish = List.append fishes "black" | |
-- TYPE MISMATCH --------------------------------------------- repl-temp-000.elm | |
The 2nd argument to function `append` is causing a mismatch. | |
5| List.append fishes "black" | |
^^^^^^^ | |
Function `append` is expecting the 2nd argument to be: | |
List String | |
But it is: | |
String | |
Hint: I always figure out the type of arguments from left to right. If an | |
argument is acceptable when I check it, I assume it is "correct" in subsequent | |
checks. So the problem may actually be in how previous arguments interact with | |
the 2nd. | |
> moreFish = List.append fishes ["black"] | |
["red","blue","green","black"] : List String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment