Haskell class Num not contained in Ord?

后端 未结 1 1901
轻奢々
轻奢々 2021-01-03 19:51

I was reading LYAH and read that the Num class isn\'t a subset of Ord. This means that there is a Num type which is not a member of Ord, what could constitute such a type?

相关标签:
1条回答
  • 2021-01-03 20:37

    Complex number (Data.Complex.Complex) is one example which is a number (Num) but cannot be ordered (not Ord).

    0 讨论(0)
提交回复
热议问题