PrimitiveArray-0.7.1.0: Efficient multidimensional arrays

Safe HaskellNone
LanguageHaskell2010

Data.PrimitiveArray.Index.Set

Contents

Description

Set with and without interfaces. We provide instances for sets, and sets with one or two interfaces. The First and Last annotation is purely cosmetical (apart from introducing type safety).

Synopsis

newtypes, data types, classes.

newtype Interface t Source #

Certain sets have an interface, a particular element with special meaning. In this module, certain `meanings' are already provided. These include a First element and a Last element. We phantom-type these to reduce programming overhead.

Constructors

Iter 

Fields

Instances

Vector Vector (Interface t0) Source # 
MVector MVector (Interface t0) Source # 
Eq (Interface t) Source # 

Methods

(==) :: Interface t -> Interface t -> Bool #

(/=) :: Interface t -> Interface t -> Bool #

Num (Interface t) Source # 
Ord (Interface t) Source # 
Show (Interface t) Source # 
Generic (Interface t) Source # 

Associated Types

type Rep (Interface t) :: * -> * #

Methods

from :: Interface t -> Rep (Interface t) x #

to :: Rep (Interface t) x -> Interface t #

Hashable (Interface t) Source # 

Methods

hashWithSalt :: Int -> Interface t -> Int #

hash :: Interface t -> Int #

FromJSON (Interface t) Source # 
ToJSON (Interface t) Source # 
Binary (Interface t) Source # 

Methods

put :: Interface t -> Put #

get :: Get (Interface t) #

putList :: [Interface t] -> Put #

Serialize (Interface t) Source # 

Methods

put :: Putter (Interface t) #

get :: Get (Interface t) #

NFData (Interface t) Source # 

Methods

rnf :: Interface t -> () #

Unbox (Interface t0) Source # 
Index (Interface i) Source # 
data MVector s (Interface t0) Source # 
type Rep (Interface t) Source # 
type Rep (Interface t) = D1 (MetaData "Interface" "Data.PrimitiveArray.Index.Set" "PrimitiveArray-0.7.1.0-B4A9oZDNxHW51HjshiHgYe" True) (C1 (MetaCons "Iter" PrefixI True) (S1 (MetaSel (Just Symbol "getIter") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))
data Vector (Interface t0) Source # 

data First Source #

Declare the interface to be the start of a path.

data Last Source #

Declare the interface to be the end of a path.

data Any Source #

Declare the interface to match anything.

TODO needed? want to use later in ADPfusion

newtype BitSet t Source #

Newtype for a bitset. We'd use Words but that requires more shape instances.

TODO can we use Words now?

Constructors

BitSet 

Fields

Instances

Vector Vector (BitSet t0) Source # 
MVector MVector (BitSet t0) Source # 

Methods

basicLength :: MVector s (BitSet t0) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (BitSet t0) -> MVector s (BitSet t0) #

basicOverlaps :: MVector s (BitSet t0) -> MVector s (BitSet t0) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (BitSet t0)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> BitSet t0 -> m (MVector (PrimState m) (BitSet t0)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> Int -> m (BitSet t0) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> Int -> BitSet t0 -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> BitSet t0 -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> MVector (PrimState m) (BitSet t0) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> MVector (PrimState m) (BitSet t0) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (BitSet t0) -> Int -> m (MVector (PrimState m) (BitSet t0)) #

Eq (BitSet t) Source # 

Methods

(==) :: BitSet t -> BitSet t -> Bool #

(/=) :: BitSet t -> BitSet t -> Bool #

Num (BitSet t) Source # 

Methods

(+) :: BitSet t -> BitSet t -> BitSet t #

(-) :: BitSet t -> BitSet t -> BitSet t #

(*) :: BitSet t -> BitSet t -> BitSet t #

negate :: BitSet t -> BitSet t #

abs :: BitSet t -> BitSet t #

signum :: BitSet t -> BitSet t #

fromInteger :: Integer -> BitSet t #

Ord (BitSet t) Source # 

Methods

compare :: BitSet t -> BitSet t -> Ordering #

(<) :: BitSet t -> BitSet t -> Bool #

(<=) :: BitSet t -> BitSet t -> Bool #

(>) :: BitSet t -> BitSet t -> Bool #

(>=) :: BitSet t -> BitSet t -> Bool #

max :: BitSet t -> BitSet t -> BitSet t #

min :: BitSet t -> BitSet t -> BitSet t #

Read (BitSet t) Source # 
Show (BitSet t) Source # 

Methods

showsPrec :: Int -> BitSet t -> ShowS #

show :: BitSet t -> String #

showList :: [BitSet t] -> ShowS #

Generic (BitSet t) Source # 

Associated Types

type Rep (BitSet t) :: * -> * #

Methods

from :: BitSet t -> Rep (BitSet t) x #

to :: Rep (BitSet t) x -> BitSet t #

Arbitrary (BitSet t) Source # 

Methods

arbitrary :: Gen (BitSet t) #

shrink :: BitSet t -> [BitSet t] #

Hashable (BitSet t) Source # 

Methods

hashWithSalt :: Int -> BitSet t -> Int #

hash :: BitSet t -> Int #

FromJSON (BitSet t) Source # 
ToJSON (BitSet t) Source # 
Bits (BitSet t) Source # 

Methods

(.&.) :: BitSet t -> BitSet t -> BitSet t #

(.|.) :: BitSet t -> BitSet t -> BitSet t #

xor :: BitSet t -> BitSet t -> BitSet t #

complement :: BitSet t -> BitSet t #

shift :: BitSet t -> Int -> BitSet t #

rotate :: BitSet t -> Int -> BitSet t #

zeroBits :: BitSet t #

bit :: Int -> BitSet t #

setBit :: BitSet t -> Int -> BitSet t #

clearBit :: BitSet t -> Int -> BitSet t #

complementBit :: BitSet t -> Int -> BitSet t #

testBit :: BitSet t -> Int -> Bool #

bitSizeMaybe :: BitSet t -> Maybe Int #

bitSize :: BitSet t -> Int #

isSigned :: BitSet t -> Bool #

shiftL :: BitSet t -> Int -> BitSet t #

unsafeShiftL :: BitSet t -> Int -> BitSet t #

shiftR :: BitSet t -> Int -> BitSet t #

unsafeShiftR :: BitSet t -> Int -> BitSet t #

rotateL :: BitSet t -> Int -> BitSet t #

rotateR :: BitSet t -> Int -> BitSet t #

popCount :: BitSet t -> Int #

FiniteBits (BitSet t) Source # 
Binary (BitSet t) Source # 

Methods

put :: BitSet t -> Put #

get :: Get (BitSet t) #

putList :: [BitSet t] -> Put #

Ranked (BitSet t) Source # 

Methods

lsb :: BitSet t -> Int #

rank :: BitSet t -> Int #

nlz :: BitSet t -> Int #

Serialize (BitSet t) Source # 

Methods

put :: Putter (BitSet t) #

get :: Get (BitSet t) #

NFData (BitSet t) Source # 

Methods

rnf :: BitSet t -> () #

Unbox (BitSet t0) Source # 
IndexStream ((:.) Z (BitSet t)) => IndexStream (BitSet t) Source # 

Methods

streamUp :: Monad m => BitSet t -> BitSet t -> Stream m (BitSet t) Source #

streamDown :: Monad m => BitSet t -> BitSet t -> Stream m (BitSet t) Source #

Index (BitSet t) Source # 
ApplyMask (BitSet t) Source # 

Methods

applyMask :: Mask (BitSet t) -> BitSet t -> BitSet t Source #

SetPredSucc (Fixed (BitSet t)) Source # 

Methods

setSucc :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

setPred :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

SetPredSucc (BitSet t) Source # 

Methods

setSucc :: BitSet t -> BitSet t -> BitSet t -> Maybe (BitSet t) Source #

setPred :: BitSet t -> BitSet t -> BitSet t -> Maybe (BitSet t) Source #

IndexStream z => IndexStream ((:.) z (BitSet C)) Source # 

Methods

streamUp :: Monad m => (z :. BitSet C) -> (z :. BitSet C) -> Stream m (z :. BitSet C) Source #

streamDown :: Monad m => (z :. BitSet C) -> (z :. BitSet C) -> Stream m (z :. BitSet C) Source #

IndexStream z => IndexStream ((:.) z (BitSet O)) Source # 

Methods

streamUp :: Monad m => (z :. BitSet O) -> (z :. BitSet O) -> Stream m (z :. BitSet O) Source #

streamDown :: Monad m => (z :. BitSet O) -> (z :. BitSet O) -> Stream m (z :. BitSet O) Source #

IndexStream z => IndexStream ((:.) z (BitSet I)) Source # 

Methods

streamUp :: Monad m => (z :. BitSet I) -> (z :. BitSet I) -> Stream m (z :. BitSet I) Source #

streamDown :: Monad m => (z :. BitSet I) -> (z :. BitSet I) -> Stream m (z :. BitSet I) Source #

data MVector s (BitSet t0) Source # 
data MVector s (BitSet t0) = MV_BitSet (MVector s Int)
type Rep (BitSet t) Source # 
type Rep (BitSet t) = D1 (MetaData "BitSet" "Data.PrimitiveArray.Index.Set" "PrimitiveArray-0.7.1.0-B4A9oZDNxHW51HjshiHgYe" True) (C1 (MetaCons "BitSet" PrefixI True) (S1 (MetaSel (Just Symbol "getBitSet") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))
data Vector (BitSet t0) Source # 
type Mask (BitSet t) Source # 
type Mask (BitSet t) = BitSet t

data BS1 i t Source #

A bitset with one interface.

Constructors

BS1 !(BitSet t) !(Interface i) 

Instances

SetPredSucc (Fixed (BS1 i t)) Source # 

Methods

setSucc :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

setPred :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

Show (BS1 i t) Source # 

Methods

showsPrec :: Int -> BS1 i t -> ShowS #

show :: BS1 i t -> String #

showList :: [BS1 i t] -> ShowS #

Arbitrary (BS1 i t) Source # 

Methods

arbitrary :: Gen (BS1 i t) #

shrink :: BS1 i t -> [BS1 i t] #

IndexStream z => IndexStream ((:.) z (BS1 i C)) Source # 

Methods

streamUp :: Monad m => (z :. BS1 i C) -> (z :. BS1 i C) -> Stream m (z :. BS1 i C) Source #

streamDown :: Monad m => (z :. BS1 i C) -> (z :. BS1 i C) -> Stream m (z :. BS1 i C) Source #

IndexStream z => IndexStream ((:.) z (BS1 i O)) Source # 

Methods

streamUp :: Monad m => (z :. BS1 i O) -> (z :. BS1 i O) -> Stream m (z :. BS1 i O) Source #

streamDown :: Monad m => (z :. BS1 i O) -> (z :. BS1 i O) -> Stream m (z :. BS1 i O) Source #

IndexStream z => IndexStream ((:.) z (BS1 i I)) Source # 

Methods

streamUp :: Monad m => (z :. BS1 i I) -> (z :. BS1 i I) -> Stream m (z :. BS1 i I) Source #

streamDown :: Monad m => (z :. BS1 i I) -> (z :. BS1 i I) -> Stream m (z :. BS1 i I) Source #

IndexStream ((:.) Z (BS1 i t)) => IndexStream (BS1 i t) Source # 

Methods

streamUp :: Monad m => BS1 i t -> BS1 i t -> Stream m (BS1 i t) Source #

streamDown :: Monad m => BS1 i t -> BS1 i t -> Stream m (BS1 i t) Source #

Index (BS1 i t) Source # 

Methods

linearIndex :: BS1 i t -> BS1 i t -> BS1 i t -> Int Source #

smallestLinearIndex :: BS1 i t -> Int Source #

largestLinearIndex :: BS1 i t -> Int Source #

size :: BS1 i t -> BS1 i t -> Int Source #

inBounds :: BS1 i t -> BS1 i t -> BS1 i t -> Bool Source #

ApplyMask (BS1 i t) Source # 

Methods

applyMask :: Mask (BS1 i t) -> BS1 i t -> BS1 i t Source #

SetPredSucc (BS1 i t) Source # 

Methods

setSucc :: BS1 i t -> BS1 i t -> BS1 i t -> Maybe (BS1 i t) Source #

setPred :: BS1 i t -> BS1 i t -> BS1 i t -> Maybe (BS1 i t) Source #

type Mask (BS1 i t) Source # 
type Mask (BS1 i t) = BitSet t

data BS2 i j t Source #

A bitset with two interfaces.

Constructors

BS2 !(BitSet t) !(Interface i) !(Interface j) 

Instances

SetPredSucc (Fixed (BS2 i j t)) Source # 

Methods

setSucc :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

setPred :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

IndexStream z => IndexStream ((:.) z (BS2 i j C)) Source # 

Methods

streamUp :: Monad m => (z :. BS2 i j C) -> (z :. BS2 i j C) -> Stream m (z :. BS2 i j C) Source #

streamDown :: Monad m => (z :. BS2 i j C) -> (z :. BS2 i j C) -> Stream m (z :. BS2 i j C) Source #

IndexStream z => IndexStream ((:.) z (BS2 i j O)) Source # 

Methods

streamUp :: Monad m => (z :. BS2 i j O) -> (z :. BS2 i j O) -> Stream m (z :. BS2 i j O) Source #

streamDown :: Monad m => (z :. BS2 i j O) -> (z :. BS2 i j O) -> Stream m (z :. BS2 i j O) Source #

IndexStream z => IndexStream ((:.) z (BS2 i j I)) Source # 

Methods

streamUp :: Monad m => (z :. BS2 i j I) -> (z :. BS2 i j I) -> Stream m (z :. BS2 i j I) Source #

streamDown :: Monad m => (z :. BS2 i j I) -> (z :. BS2 i j I) -> Stream m (z :. BS2 i j I) Source #

Show (BS2 i j t) Source # 

Methods

showsPrec :: Int -> BS2 i j t -> ShowS #

show :: BS2 i j t -> String #

showList :: [BS2 i j t] -> ShowS #

Arbitrary (BS2 i j t) Source # 

Methods

arbitrary :: Gen (BS2 i j t) #

shrink :: BS2 i j t -> [BS2 i j t] #

IndexStream ((:.) Z (BS2 i j t)) => IndexStream (BS2 i j t) Source # 

Methods

streamUp :: Monad m => BS2 i j t -> BS2 i j t -> Stream m (BS2 i j t) Source #

streamDown :: Monad m => BS2 i j t -> BS2 i j t -> Stream m (BS2 i j t) Source #

Index (BS2 i j t) Source # 

Methods

linearIndex :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Int Source #

smallestLinearIndex :: BS2 i j t -> Int Source #

largestLinearIndex :: BS2 i j t -> Int Source #

size :: BS2 i j t -> BS2 i j t -> Int Source #

inBounds :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Bool Source #

ApplyMask (BS2 i j t) Source # 

Methods

applyMask :: Mask (BS2 i j t) -> BS2 i j t -> BS2 i j t Source #

SetPredSucc (BS2 i j t) Source # 

Methods

setSucc :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Maybe (BS2 i j t) Source #

setPred :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Maybe (BS2 i j t) Source #

type Mask (BS2 i j t) Source # 
type Mask (BS2 i j t) = BitSet t

class SetPredSucc s where Source #

Successor and Predecessor for sets. Designed as a class to accomodate sets with interfaces and without interfaces with one function.

The functions are not written recursively, as we currently only have three cases, and we do not want to "reset" while generating successors and predecessors.

Note that sets have a partial order. Within the group of element with the same popCount, we use popPermutation which has the same stepping order for both, setSucc and setPred.

Minimal complete definition

setSucc, setPred

Methods

setSucc :: s -> s -> s -> Maybe s Source #

Set successor. The first argument is the lower set limit, the second the upper set limit, the third the current set.

setPred :: s -> s -> s -> Maybe s Source #

Set predecessor. The first argument is the lower set limit, the second the upper set limit, the third the current set.

Instances

SetPredSucc (Fixed (BS2 i j t)) Source # 

Methods

setSucc :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

setPred :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

SetPredSucc (Fixed (BS1 i t)) Source # 

Methods

setSucc :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

setPred :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

SetPredSucc (Fixed (BitSet t)) Source # 

Methods

setSucc :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

setPred :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

SetPredSucc (BitSet t) Source # 

Methods

setSucc :: BitSet t -> BitSet t -> BitSet t -> Maybe (BitSet t) Source #

setPred :: BitSet t -> BitSet t -> BitSet t -> Maybe (BitSet t) Source #

SetPredSucc (BS1 i t) Source # 

Methods

setSucc :: BS1 i t -> BS1 i t -> BS1 i t -> Maybe (BS1 i t) Source #

setPred :: BS1 i t -> BS1 i t -> BS1 i t -> Maybe (BS1 i t) Source #

SetPredSucc (BS2 i j t) Source # 

Methods

setSucc :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Maybe (BS2 i j t) Source #

setPred :: BS2 i j t -> BS2 i j t -> BS2 i j t -> Maybe (BS2 i j t) Source #

type family Mask s :: * Source #

Masks are used quite often for different types of bitsets. We liberate them as a type family.

Instances

type Mask (BitSet t) Source # 
type Mask (BitSet t) = BitSet t
type Mask (BS1 i t) Source # 
type Mask (BS1 i t) = BitSet t
type Mask (BS2 i j t) Source # 
type Mask (BS2 i j t) = BitSet t

data Fixed t Source #

Fixed allows us to fix some or all bits of a bitset, thereby providing succ/pred operations which are only partially free.

The mask is lazy, this allows us to have undefined for l and h.

f = getFixedMask .&. getFixed are the fixed bits. n = getFixed .&. complement getFixedMask are the free bits. to = complement getFixed is the to move mask n' = popShiftR to n yields the population after the move p = popPermutation undefined n' yields the new population permutation p' = popShiftL to p yields the population moved back final = p' .|. f

Constructors

Fixed 

Fields

Instances

(Unbox t0, Unbox (Mask t0)) => Vector Vector (Fixed t0) Source # 

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Fixed t0) -> m (Vector (Fixed t0)) #

basicUnsafeThaw :: PrimMonad m => Vector (Fixed t0) -> m (Mutable Vector (PrimState m) (Fixed t0)) #

basicLength :: Vector (Fixed t0) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (Fixed t0) -> Vector (Fixed t0) #

basicUnsafeIndexM :: Monad m => Vector (Fixed t0) -> Int -> m (Fixed t0) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Fixed t0) -> Vector (Fixed t0) -> m () #

elemseq :: Vector (Fixed t0) -> Fixed t0 -> b -> b #

(Unbox t0, Unbox (Mask t0)) => MVector MVector (Fixed t0) Source # 

Methods

basicLength :: MVector s (Fixed t0) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (Fixed t0) -> MVector s (Fixed t0) #

basicOverlaps :: MVector s (Fixed t0) -> MVector s (Fixed t0) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Fixed t0)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> Fixed t0 -> m (MVector (PrimState m) (Fixed t0)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> Int -> m (Fixed t0) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> Int -> Fixed t0 -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> Fixed t0 -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> MVector (PrimState m) (Fixed t0) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> MVector (PrimState m) (Fixed t0) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Fixed t0) -> Int -> m (MVector (PrimState m) (Fixed t0)) #

(Eq t, Eq (Mask t)) => Eq (Fixed t) Source # 

Methods

(==) :: Fixed t -> Fixed t -> Bool #

(/=) :: Fixed t -> Fixed t -> Bool #

(Ord t, Ord (Mask t)) => Ord (Fixed t) Source # 

Methods

compare :: Fixed t -> Fixed t -> Ordering #

(<) :: Fixed t -> Fixed t -> Bool #

(<=) :: Fixed t -> Fixed t -> Bool #

(>) :: Fixed t -> Fixed t -> Bool #

(>=) :: Fixed t -> Fixed t -> Bool #

max :: Fixed t -> Fixed t -> Fixed t #

min :: Fixed t -> Fixed t -> Fixed t #

(Read t, Read (Mask t)) => Read (Fixed t) Source # 
(Show t, Show (Mask t)) => Show (Fixed t) Source # 

Methods

showsPrec :: Int -> Fixed t -> ShowS #

show :: Fixed t -> String #

showList :: [Fixed t] -> ShowS #

(Generic t, Generic (Mask t)) => Generic (Fixed t) Source # 

Associated Types

type Rep (Fixed t) :: * -> * #

Methods

from :: Fixed t -> Rep (Fixed t) x #

to :: Rep (Fixed t) x -> Fixed t #

(Arbitrary t, Arbitrary (Mask t)) => Arbitrary (Fixed t) Source # 

Methods

arbitrary :: Gen (Fixed t) #

shrink :: Fixed t -> [Fixed t] #

(Generic t, Generic (Mask t), Hashable t, Hashable (Mask t)) => Hashable (Fixed t) Source # 

Methods

hashWithSalt :: Int -> Fixed t -> Int #

hash :: Fixed t -> Int #

(Generic t, Generic (Mask t), Binary t, Binary (Mask t)) => Binary (Fixed t) Source # 

Methods

put :: Fixed t -> Put #

get :: Get (Fixed t) #

putList :: [Fixed t] -> Put #

(Generic t, Generic (Mask t), Serialize t, Serialize (Mask t)) => Serialize (Fixed t) Source # 

Methods

put :: Putter (Fixed t) #

get :: Get (Fixed t) #

NFData (Fixed t) Source # 

Methods

rnf :: Fixed t -> () #

(Unbox t0, Unbox (Mask t0)) => Unbox (Fixed t0) Source # 
SetPredSucc (Fixed (BS2 i j t)) Source # 

Methods

setSucc :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

setPred :: Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Fixed (BS2 i j t) -> Maybe (Fixed (BS2 i j t)) Source #

SetPredSucc (Fixed (BS1 i t)) Source # 

Methods

setSucc :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

setPred :: Fixed (BS1 i t) -> Fixed (BS1 i t) -> Fixed (BS1 i t) -> Maybe (Fixed (BS1 i t)) Source #

SetPredSucc (Fixed (BitSet t)) Source # 

Methods

setSucc :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

setPred :: Fixed (BitSet t) -> Fixed (BitSet t) -> Fixed (BitSet t) -> Maybe (Fixed (BitSet t)) Source #

data MVector s (Fixed t0) Source # 
data MVector s (Fixed t0) = MV_Fixed (MVector s (Mask t, t))
type Rep (Fixed t) Source # 
type Rep (Fixed t) = D1 (MetaData "Fixed" "Data.PrimitiveArray.Index.Set" "PrimitiveArray-0.7.1.0-B4A9oZDNxHW51HjshiHgYe" False) (C1 (MetaCons "Fixed" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "getFixedMask") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Mask t))) (S1 (MetaSel (Just Symbol "getFixed") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 t))))
data Vector (Fixed t0) Source # 
data Vector (Fixed t0) = V_Fixed (Vector (Mask t, t))

class ApplyMask s where Source #

Assuming a bitset on bits [0 .. highbit], we can apply a mask that stretches out those bits over [0 .. higherBit] with highbit <= higherBit. Any active interfaces are correctly set as well.

Minimal complete definition

applyMask

Methods

applyMask :: Mask s -> s -> s Source #

Instances

ApplyMask (BitSet t) Source # 

Methods

applyMask :: Mask (BitSet t) -> BitSet t -> BitSet t Source #

ApplyMask (BS1 i t) Source # 

Methods

applyMask :: Mask (BS1 i t) -> BS1 i t -> BS1 i t Source #

ApplyMask (BS2 i j t) Source # 

Methods

applyMask :: Mask (BS2 i j t) -> BS2 i j t -> BS2 i j t Source #

Instances

streamUpBsMk :: (Monad m, Ord a) => a -> a -> t -> m (t, Maybe a) Source #

streamUpBsStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

streamDownBsMk :: (Monad m, Ord a) => a -> a -> t -> m (t, Maybe a) Source #

streamDownBsStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

BS1

streamUpBsIMk :: Monad m => BS1 a i -> BS1 b i -> z -> m (z, Maybe (BS1 c i)) Source #

streamUpBsIStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

streamDownBsIMk :: Monad m => BS1 a i -> BS1 b i -> z -> m (z, Maybe (BS1 c i)) Source #

streamDownBsIStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

BS2

streamUpBsIiMk :: Monad m => BS2 a b i -> BS2 c d i -> z -> m (z, Maybe (BS2 e f i)) Source #

streamUpBsIiStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

streamDownBsIiMk :: Monad m => BS2 a b i -> BS2 c d i -> z -> m (z, Maybe (BS2 e f i)) Source #

streamDownBsIiStep :: (Monad m, SetPredSucc s) => s -> s -> (t, Maybe s) -> m (Step (t, Maybe s) (t :. s)) Source #

Set predecessor and successor