Skip to content

Commit

Permalink
Fix build on GHC9
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma committed Mar 14, 2023
1 parent 4b397fb commit 594f53d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions base32-z-bytestring.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ test-suite tests
, base32-z-bytestring
, bytestring
, hedgehog
, hspec
, tasty
, tasty-fail-fast
, tasty-hedgehog
Expand Down
6 changes: 3 additions & 3 deletions src/Data/ByteString/Base32/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Word5 = Word8
-----------------------------------------------------------------------}

unpack5Ptr :: Ptr Word8 -> ByteString -> ByteString
unpack5Ptr !tbl bs @ (PS fptr off sz) =
unpack5Ptr !tbl bs@(PS fptr off sz) =
unsafePerformIO $ do
let unpackedSize = dstSize $ BS.length bs
BS.create unpackedSize $ \ dst -> do
Expand Down Expand Up @@ -136,7 +136,7 @@ cleanup io = unsafePerformIO $
handler (ErrorCall msg) = return (Left msg)

pack5Ptr :: Ptr Word5 -> ByteString -> Result ByteString
pack5Ptr !tbl bs @ (PS fptr off sz) =
pack5Ptr !tbl bs@(PS fptr off sz) =
cleanup $ do
let packedSize = dstSize $ BS.length bs
BS.createAndTrim packedSize $ \ dst -> do
Expand Down Expand Up @@ -223,7 +223,7 @@ isInAlphabet !tbl !ix =
unsafePerformIO (peekByteOff tbl (fromIntegral ix)) /= invIx

pack5Lenient :: DecTable -> ByteString -> Either String ByteString
pack5Lenient tbl @ (PS fptr _ _) bs =
pack5Lenient tbl@(PS fptr _ _) bs =
unsafePerformIO $ do
withForeignPtr fptr $ \ !tbl_ptr -> do
return $! pack5 tbl $ BS.filter (isInAlphabet tbl_ptr) bs
1 change: 1 addition & 0 deletions test/Test/Data/ByteString/Base32.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import System.IO.Unsafe (unsafePerformIO)
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Test.Hspec
import Test.Tasty
import Test.Tasty.Hedgehog
import Test.Tasty.Hspec
Expand Down

0 comments on commit 594f53d

Please sign in to comment.