我需要一组独特的记录。但是Elm Core的 Set
将集合成员限制为可比较的
:
import Set exposing (Set)
mySet = Set.empty
Set.insert {name="Foo"} mySet
-- TYPE MISMATCH ----------------------------------------------------------- elm
The 1st argument to `insert` is not what I expect:
6| Set.insert {name="Foo"} mySet
^^^^^^^^^^^^
This argument is a record of type:
{ name : String }
But `insert` needs the 1st argument to be:
comparable
Hint: Only ints, floats, chars, strings, lists, and tuples are comparable.
如何在Elm中创建一个记录集?