Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on GHC9 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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