Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry picked commits from #88 #92

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading