鑑於Ord
類型類:類型類w /`min`?
Prelude> :i Ord
class Eq a => Ord a where
compare :: a -> a -> Ordering
(<) :: a -> a -> Bool
(<=) :: a -> a -> Bool
(>) :: a -> a -> Bool
(>=) :: a -> a -> Bool
max :: a -> a -> a
min :: a -> a -> a
有沒有一種類型的類,對於一個給定類型提供了min : a
場/功能?
實施例:
min :: Int
將輸出的最小Int
值。
你在找什麼是['Bounded'](http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Bounded)typeclass。 – baxbaxwalanuksiwe