Skip to content

Commit 3100be7

Browse files
committed
Implement new uniformByteArrayM
1 parent 7573784 commit 3100be7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

System/Random/MWC.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,13 @@ instance (s ~ PrimState m, PrimMonad m) => Random.StatefulGen (Gen s) m where
465465
{-# INLINE uniformWord32 #-}
466466
uniformWord64 = uniform
467467
{-# INLINE uniformWord64 #-}
468+
#if MIN_VERSION_random(1,3,0)
469+
uniformByteArrayM isPinned n g = stToPrim (Random.genByteArrayST isPinned n (uniform g))
470+
{-# INLINE uniformByteArrayM #-}
471+
#else
468472
uniformShortByteString n g = stToPrim (Random.genShortByteStringST n (uniform g))
469473
{-# INLINE uniformShortByteString #-}
474+
#endif
470475

471476
-- | @since 0.15.0.0
472477
instance PrimMonad m => Random.FrozenGen Seed m where

0 commit comments

Comments
 (0)