From 3278904ebd2202126edffe62fa395aba2be88fbc Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Mon, 7 Dec 2020 07:23:02 +0000 Subject: [PATCH] Update laws for isInRange --- src/System/Random/Internal.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/System/Random/Internal.hs b/src/System/Random/Internal.hs index 170cca72..e53dc025 100644 --- a/src/System/Random/Internal.hs +++ b/src/System/Random/Internal.hs @@ -617,17 +617,14 @@ class UniformRange a where -- -- > isInRange (lo, hi) lo == True -- - -- Ranges are transitive relations: + -- When endpoints coincide, there is nothing else: -- - -- > isInRange (lo, hi) mid && isInRange (lo, mid) x ==> isInRange (lo, hi) x + -- > isInRange (x, x) y == x == y -- - -- Ranges are injective (up to symmetry), which means that - -- ranges between different endpoints cannot be the same: + -- Ranges are transitive relations: -- - -- > (a, b) == (c, d) || (a, b) == (d, c) || - -- > there exists x such that - -- > isInRange (a, b) x && not (isInRange (c, d) x) - -- > || isInRange (c, d) x && not (isInRange (a, b) x) + -- > isInRange (lo, hi) lo' && isInRange (lo, hi) hi' && + -- > && isInRange (lo', hi') x ==> isInRange (lo, hi) x -- -- @since 1.3.0 isInRange :: (a, a) -> a -> Bool