Skip to content

Commit

Permalink
Implement new uniformByteArrayM
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Nov 24, 2023
1 parent 7573784 commit 3100be7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions System/Random/MWC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,13 @@ instance (s ~ PrimState m, PrimMonad m) => Random.StatefulGen (Gen s) m where
{-# INLINE uniformWord32 #-}
uniformWord64 = uniform
{-# INLINE uniformWord64 #-}
#if MIN_VERSION_random(1,3,0)
uniformByteArrayM isPinned n g = stToPrim (Random.genByteArrayST isPinned n (uniform g))
{-# INLINE uniformByteArrayM #-}
#else
uniformShortByteString n g = stToPrim (Random.genShortByteStringST n (uniform g))
{-# INLINE uniformShortByteString #-}
#endif

-- | @since 0.15.0.0
instance PrimMonad m => Random.FrozenGen Seed m where
Expand Down

0 comments on commit 3100be7

Please sign in to comment.