相关疑难解决方法(0)

榆树的可比性意味着什么?

我无法理解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 是不是媲美?
为什么类型f2number …

elm

9
推荐指数
2
解决办法
3706
查看次数

标签 统计

elm ×1