From 9f5a76f9f33bfe7d7e7333970d7adf46a6657a1c Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 26 Feb 2024 15:06:27 -0500 Subject: [PATCH] Fix src-assertions/Assertion.hs build error and remove unliftedarrayfunctions cabal flag --- posix-api.cabal | 12 +----------- src-assertions/Assertion.hs | 14 +++----------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/posix-api.cabal b/posix-api.cabal index 70095b6..1d1bbe0 100644 --- a/posix-api.cabal +++ b/posix-api.cabal @@ -82,13 +82,6 @@ flag assertions description: Extra run-time invariant checking default: False --- This only exists to help get this library to build on hackage. --- Whenever hackage moves to GHC 9.4, remove this. -flag unliftedarrayfunctions - manual: True - description: Build and export functions using unlifted arrays - default: True - common build-settings default-language: Haskell2010 ghc-options: -Wall -Wunused-packages @@ -126,15 +119,12 @@ library , base >=4.16.3 && <5 , byte-order >=0.1.2 && <0.2 , byteslice >=0.2.10 && <0.3 - , primitive >=0.7 && <0.10 + , primitive >=0.9 && <0.10 , primitive-addr >=0.1 && <0.2 , primitive-offset >=0.2 && <0.3 , run-st >=0.1.1 && <0.2 , text-short >=0.1.5 - if flag(unliftedarrayfunctions) - build-depends: primitive-unlifted >=2.1 && <2.2 - hs-source-dirs: src if flag(assertions) diff --git a/src-assertions/Assertion.hs b/src-assertions/Assertion.hs index 8303667..b975b1a 100644 --- a/src-assertions/Assertion.hs +++ b/src-assertions/Assertion.hs @@ -13,24 +13,16 @@ import qualified GHC.Exts as Exts assertMutablePrimArrayPinned :: PM.MutablePrimArray s a -> PM.MutablePrimArray s a assertMutablePrimArrayPinned x = - if isMutablePrimArrayPinned x + if PM.isMutablePrimArrayPinned x then x else error "assertMutablePrimArrayPinned" -assertMutableByteArrayPinned :: PM.MutablePrimArray s a -> PM.MutablePrimArray s a +assertMutableByteArrayPinned :: PM.MutableByteArray s -> PM.MutableByteArray s assertMutableByteArrayPinned x = - if isMutableByteArrayPinned x + if PM.isMutableByteArrayPinned x then x else error "assertMutableByteArrayPinned" -isMutablePrimArrayPinned :: PM.MutablePrimArray s a -> Bool -{-# INLINE isMutablePrimArrayPinned #-} -isMutablePrimArrayPinned (PM.MutablePrimArray marr#) = isTrue# (Exts.isMutableByteArrayPinned# marr#) - -isMutableByteArrayPinned :: PM.MutableByteArray s -> Bool -{-# INLINE isMutableByteArrayPinned #-} -isMutableByteArrayPinned (PM.MutableByteArray marr#) = isTrue# (Exts.isMutableByteArrayPinned# marr#) - assertByteArrayPinned :: PM.ByteArray -> PM.ByteArray assertByteArrayPinned x = if PM.isByteArrayPinned x