Skip to content

Commit

Permalink
Update laws for isInRange
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Jan 18, 2021
1 parent 3174b0c commit 3278904
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/System/Random/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3278904

Please sign in to comment.