From 6d11ba788fead00dacc4642797ddd6d815e634f3 Mon Sep 17 00:00:00 2001 From: Alexey Kuleshevich Date: Sun, 29 Oct 2023 15:24:50 +0100 Subject: [PATCH] Implement new `uniformByteArrayM` --- System/Random/MWC.hs | 4 ++++ stack.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/System/Random/MWC.hs b/System/Random/MWC.hs index f5a235e..b84a97c 100644 --- a/System/Random/MWC.hs +++ b/System/Random/MWC.hs @@ -465,6 +465,10 @@ 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 #-} +#endif uniformShortByteString n g = stToPrim (Random.genShortByteStringST n (uniform g)) {-# INLINE uniformShortByteString #-} diff --git a/stack.yaml b/stack.yaml index d43a951..f253ca8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -4,5 +4,5 @@ packages: extra-deps: - github: haskell/random - commit: 81161a22de4bbc8de51af6e811eef8311b05ccc0 + commit: 04a50941c8e1ebdac0e01f4354eae965c5adfa50 allow-newer: true