Skip to content

Commit

Permalink
Merge pull request #180 from RyanGlScott/T178-warn-against-default-im…
Browse files Browse the repository at this point in the history
…pl-of-inRange

Document that `Data.Ix.inRange` is not a suitable default for `isInRange`
  • Loading branch information
lehins authored Jan 23, 2025
2 parents 0d94513 + 47ba3cc commit 8775221
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/System/Random/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,12 @@ class UniformRange a where
--
-- There is a default implementation of 'isInRange' via 'Generic'. Other helper function
-- that can be used for implementing this function are `isInRangeOrd` and
-- `isInRangeEnum`
-- `isInRangeEnum`.
--
-- Note that the @isRange@ method from @Data.Ix@ is /not/ a suitable default
-- implementation of 'isInRange'. Unlike 'isInRange', @isRange@ is not
-- required to be symmetric, and many @isRange@ implementations are not
-- symmetric in practice.
--
-- @since 1.3.0
isInRange :: (a, a) -> a -> Bool
Expand Down

0 comments on commit 8775221

Please sign in to comment.