Ord型クラス
methods
(>), (<), (>=), (<=)
code:hs
class Eq a => Ord a where
compare :: a -> a -> Ordering
(<), (<=), (>), (>=) :: a -> a -> Bool
max, min :: a -> a -> a
code:ts
import { Eq } from 'fp-ts/lib/Eq'
type Ordering = -1 | 0 | 1
interface Ord<A> extends Eq<A> {
readonly compare: (first: A, second: A) => Ordering
}
Ordering
first > secondなら-1
first == secondなら0
first < secondなら1