閱讀http://eed3si9n.com/learning-scalaz/Order.html這個例子說明:scalaz.Ordering這種情況的用途是什麼?
scala> 1.0 ?|? 2.0
res10: scalaz.Ordering = LT
所有這一切都關於訂購說明是:
「
scala> 1 > 2.0
res8: Boolean = false
scala> 1 gt 2.0
<console>:14: error: could not find implicit value for parameter F0: scalaz.Order[Any]
1 gt 2.0
^
scala> 1.0 ?|? 2.0
res10: scalaz.Ordering = LT
scala> 1.0 max 2.0
res11: Double = 2.0
Order enables ?|? syntax which returns Ordering: LT, GT, and EQ. It also enables lt, gt, lte, gte, min, and max operators by declaring order method. Similar to Equal, comparing Int and Doubl fails compilation.
」
什麼是scalaz的意義。在這種情況下訂購?
1.0 max 2.0是否使用標準的Scala API max方法並且不涉及scalaz?
感謝爲例「一些(2.0)最大一些(1.0)」,非常有用 – 2014-09-21 22:50:20
我剛剛打開一個問題https://github.com/eed3si9n/learning-scalaz/issues/9 – 2014-09-23 12:42:04