Skip to content

Commit

Permalink
Fix order of arguments in uniformR
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Apr 28, 2020
1 parent 0d51fa4 commit bb2d26a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions System/Random.hs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ uniform g = runGenState g uniformM
-- | Pure version of `uniformRM` that works with instances of `RandomGen`
--
-- @since 1.2
uniformR :: (RandomGen g, UniformRange a) => g -> (a, a) -> (a, g)
uniformR g r = runGenState g (uniformRM r)
uniformR :: (RandomGen g, UniformRange a) => (a, a) -> g -> (a, g)
uniformR r g = runGenState g (uniformRM r)

-- | Generates a 'ByteString' of the specified size using a pure pseudo-random
-- number generator. See 'uniformByteString' for the monadic version.
Expand Down
2 changes: 1 addition & 1 deletion bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pureUniformRIncludeHalfEnumBench =
pureUniformRBench :: forall a. (Typeable a, UniformRange a) => (a, a) -> Int -> Benchmark
pureUniformRBench range =
let !stdGen = mkStdGen 1337
in pureBench @a (genMany (flip uniformR range) stdGen)
in pureBench @a (genMany (uniformR range) stdGen)

pureBench :: forall a. (Typeable a) => (Int -> ()) -> Int -> Benchmark
pureBench f sz = bench (showsTypeRep (typeRep (Proxy :: Proxy a)) "") $ nf f sz
Expand Down

0 comments on commit bb2d26a

Please sign in to comment.