Skip to content

Commit

Permalink
Merge pull request #92 from Shimuuar/chery-picking
Browse files Browse the repository at this point in the history
Cherry picked commits from #88
  • Loading branch information
Shimuuar authored May 9, 2024
2 parents 4d6f27e + a801bf4 commit d37e6f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions System/Random/MWC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ module System.Random.MWC
#endif

import Control.Monad (ap, liftM, unless)
import Control.Monad.Primitive (PrimMonad, PrimBase, PrimState, unsafePrimToIO, unsafeSTToPrim)
import Control.Monad.Primitive (PrimMonad, PrimBase, PrimState, unsafePrimToIO, stToPrim)
import Control.Monad.ST (ST,runST)
import Data.Bits ((.&.), (.|.), shiftL, shiftR, xor)
import Data.Int (Int8, Int16, Int32, Int64)
Expand Down Expand Up @@ -463,7 +463,7 @@ instance (s ~ PrimState m, PrimMonad m) => Random.StatefulGen (Gen s) m where
{-# INLINE uniformWord32 #-}
uniformWord64 = uniform
{-# INLINE uniformWord64 #-}
uniformShortByteString n g = unsafeSTToPrim (Random.genShortByteStringST n (uniform g))
uniformShortByteString n g = stToPrim (Random.genShortByteStringST n (uniform g))
{-# INLINE uniformShortByteString #-}

-- | @since 0.15.0.0
Expand Down
3 changes: 2 additions & 1 deletion System/Random/MWC/SeedSource.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import Foreign.Marshal.Array (peekArray)
#if defined(mingw32_HOST_OS)
import Foreign.Ptr
import Foreign.C.Types
#else
import System.IO (IOMode(..), hGetBuf, withBinaryFile)
#endif
import System.CPUTime (cpuTimePrecision, getCPUTime)
import System.IO (IOMode(..), hGetBuf, withBinaryFile)

-- Acquire seed from current time. This is horrible fallback for
-- Windows system.
Expand Down
3 changes: 0 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
packages:
mwc-random.cabal

allow-newer:QuickCheck:splitmix
allow-newer:QuickCheck:random

0 comments on commit d37e6f6

Please sign in to comment.