Skip to content

Commit 6f8efd2

Browse files
committed
Require vector>=0.13
1 parent 1f1a2f3 commit 6f8efd2

2 files changed

Lines changed: 2 additions & 23 deletions

File tree

bitvec.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ library
7777
deepseq <1.6,
7878
ghc-bignum <1.5,
7979
primitive >=0.5 && <0.10,
80-
vector >=0.11 && <0.14
80+
vector >=0.13 && <0.14
8181
default-language: Haskell2010
8282
hs-source-dirs: src
8383
other-modules:

src/Data/Bit/Internal.hs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ module Data.Bit.InternalTS
2525
, modifyByteArray
2626
) where
2727

28-
#if MIN_VERSION_vector(0,13,0)
29-
import Data.Vector.Internal.Check (checkIndex, Checks(..))
30-
#else
31-
#include "vector.h"
32-
#endif
33-
3428
import Control.DeepSeq
3529
import Control.Exception
3630
import Control.Monad.Primitive
@@ -41,6 +35,7 @@ import Data.Primitive.ByteArray
4135
import Data.Ratio
4236
import qualified Data.Vector.Generic as V
4337
import qualified Data.Vector.Generic.Mutable as MV
38+
import Data.Vector.Internal.Check (checkIndex, Checks(..))
4439
import qualified Data.Vector.Unboxed as U
4540
import GHC.Generics
4641

@@ -436,11 +431,7 @@ instance MV.MVector U.MVector Bit where
436431
-- @since 1.0.0.0
437432
unsafeFlipBit :: PrimMonad m => U.MVector (PrimState m) Bit -> Int -> m ()
438433
unsafeFlipBit v i =
439-
#if MIN_VERSION_vector(0,13,0)
440434
checkIndex Unsafe
441-
#else
442-
UNSAFE_CHECK(checkIndex) "flipBit"
443-
#endif
444435
i (MV.length v) $ basicFlipBit v i
445436
{-# INLINE unsafeFlipBit #-}
446437

@@ -469,11 +460,7 @@ basicFlipBit (BitMVec off _ arr) !i' = do
469460
-- @since 1.0.0.0
470461
flipBit :: PrimMonad m => U.MVector (PrimState m) Bit -> Int -> m ()
471462
flipBit v i =
472-
#if MIN_VERSION_vector(0,13,0)
473463
checkIndex Bounds
474-
#else
475-
BOUNDS_CHECK(checkIndex) "flipBit"
476-
#endif
477464
i (MV.length v) $
478465
unsafeFlipBit v i
479466
{-# INLINE flipBit #-}
@@ -493,11 +480,7 @@ flipBit v i =
493480
-- [1,0,1]
494481
unsafeFlipBit :: PrimMonad m => U.MVector (PrimState m) Bit -> Int -> m ()
495482
unsafeFlipBit v i =
496-
#if MIN_VERSION_vector(0,13,0)
497483
checkIndex Unsafe
498-
#else
499-
UNSAFE_CHECK(checkIndex) "flipBit"
500-
#endif
501484
i (MV.length v) $ basicFlipBit v i
502485
{-# INLINE unsafeFlipBit #-}
503486

@@ -522,11 +505,7 @@ basicFlipBit (BitMVec off _ (MutableByteArray mba)) !i' = do
522505
-- [1,0,1]
523506
flipBit :: PrimMonad m => U.MVector (PrimState m) Bit -> Int -> m ()
524507
flipBit v i =
525-
#if MIN_VERSION_vector(0,13,0)
526508
checkIndex Bounds
527-
#else
528-
BOUNDS_CHECK(checkIndex) "flipBit"
529-
#endif
530509
i (MV.length v) $ basicFlipBit v i
531510
{-# INLINE flipBit #-}
532511

0 commit comments

Comments
 (0)