From 2e8d4279c705d03434d691b2e434a8c06cc3f277 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Wed, 4 Sep 2019 13:40:31 -0400 Subject: [PATCH] use runByteArrayST instead of runST --- src/Data/ByteArray/Builder/Bounded.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Data/ByteArray/Builder/Bounded.hs b/src/Data/ByteArray/Builder/Bounded.hs index e45442f..0450234 100644 --- a/src/Data/ByteArray/Builder/Bounded.hs +++ b/src/Data/ByteArray/Builder/Bounded.hs @@ -51,7 +51,8 @@ module Data.ByteArray.Builder.Bounded import Arithmetic.Types (type (<=), type (:=:)) import Control.Monad.Primitive -import Control.Monad.ST +import Control.Monad.ST (ST) +import Control.Monad.ST.Run (runByteArrayST) import Data.Bits import Data.ByteArray.Builder.Bounded.Unsafe (Builder(..)) import Data.Char (ord) @@ -76,7 +77,7 @@ run :: -> Builder n -- ^ Builder -> ByteArray {-# inline run #-} -run n b = runST $ do +run n b = runByteArrayST $ do arr <- newByteArray (Nat.demote n) len <- Unsafe.pasteST b arr 0 shrinkMutableByteArray arr len