我无法理解comparable榆树究竟是什么.榆树似乎和我一样困惑.
在REPL上:
> f1 = (<)
<function> : comparable -> comparable -> Bool
Run Code Online (Sandbox Code Playgroud)
所以f1接受可比较的.
> "a"
"a" : String
> f1 "a" "b"
True : Bool
Run Code Online (Sandbox Code Playgroud)
所以它似乎String具有可比性.
> f2 = (<) 1
<function> : comparable -> Bool
Run Code Online (Sandbox Code Playgroud)
所以f2接受可比的.
> f2 "a"
As I infer the type of values flowing through your program, I see a conflict
between these two types:
comparable
String
Run Code Online (Sandbox Code Playgroud)
所以,String 是和是不是媲美?
为什么类型f2不number …
elm ×1