Commit d2271fe4 authored by Simon Jakobi's avatar Simon Jakobi Committed by Marge Bot

Ord docs: Add explanation on 'min' and 'max' operator interactions

[ci skip]
parent 6094d43f
......@@ -331,6 +331,10 @@ instance Ord TyCon where
-- 7. @min x y == if x <= y then x else y@ = 'True'
-- 8. @max x y == if x >= y then x else y@ = 'True'
--
-- Note that (7.) and (8.) do /not/ require 'min' and 'max' to return either of
-- their arguments. The result is merely required to /equal/ one of the
-- arguments in terms of '(==)'.
--
-- Minimal complete definition: either 'compare' or '<='.
-- Using 'compare' can be more efficient for complex types.
--
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment