PrimitiveArray-0.10.1.0: Efficient multidimensional arrays
Safe HaskellNone
LanguageHaskell2010

Data.PrimitiveArray.Index.Class

Synopsis

Documentation

data a :. b infixl 3 Source #

Strict pairs -- as in repa.

Constructors

!a :. !b infixl 3 

Instances

Instances details
(Unbox a, Unbox b) => Vector Vector (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a :. b) -> m (Vector (a :. b)) #

basicUnsafeThaw :: PrimMonad m => Vector (a :. b) -> m (Mutable Vector (PrimState m) (a :. b)) #

basicLength :: Vector (a :. b) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a :. b) -> Vector (a :. b) #

basicUnsafeIndexM :: Monad m => Vector (a :. b) -> Int -> m (a :. b) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a :. b) -> Vector (a :. b) -> m () #

elemseq :: Vector (a :. b) -> (a :. b) -> b0 -> b0 #

(Unbox a, Unbox b) => MVector MVector (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

basicLength :: MVector s (a :. b) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a :. b) -> MVector s (a :. b) #

basicOverlaps :: MVector s (a :. b) -> MVector s (a :. b) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a :. b)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a :. b) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a :. b) -> m (MVector (PrimState m) (a :. b)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a :. b) -> Int -> m (a :. b) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a :. b) -> Int -> (a :. b) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a :. b) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a :. b) -> (a :. b) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a :. b) -> MVector (PrimState m) (a :. b) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a :. b) -> MVector (PrimState m) (a :. b) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a :. b) -> Int -> m (MVector (PrimState m) (a :. b)) #

(Bounded (LimitType zs), Bounded (LimitType z)) => Bounded (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

minBound :: LimitType (zs :. z) #

maxBound :: LimitType (zs :. z) #

(Eq (LimitType zs), Eq (LimitType z)) => Eq (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

(==) :: LimitType (zs :. z) -> LimitType (zs :. z) -> Bool #

(/=) :: LimitType (zs :. z) -> LimitType (zs :. z) -> Bool #

(Data zs, Data (LimitType zs), Typeable zs, Data z, Data (LimitType z), Typeable z) => Data (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LimitType (zs :. z) -> c (LimitType (zs :. z)) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LimitType (zs :. z)) #

toConstr :: LimitType (zs :. z) -> Constr #

dataTypeOf :: LimitType (zs :. z) -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LimitType (zs :. z))) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LimitType (zs :. z))) #

gmapT :: (forall b. Data b => b -> b) -> LimitType (zs :. z) -> LimitType (zs :. z) #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LimitType (zs :. z) -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LimitType (zs :. z) -> r #

gmapQ :: (forall d. Data d => d -> u) -> LimitType (zs :. z) -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LimitType (zs :. z) -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LimitType (zs :. z) -> m (LimitType (zs :. z)) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LimitType (zs :. z) -> m (LimitType (zs :. z)) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LimitType (zs :. z) -> m (LimitType (zs :. z)) #

(Read (LimitType zs), Read (LimitType z)) => Read (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

(Show (LimitType zs), Show (LimitType z)) => Show (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

showsPrec :: Int -> LimitType (zs :. z) -> ShowS #

show :: LimitType (zs :. z) -> String #

showList :: [LimitType (zs :. z)] -> ShowS #

(Generic (LimitType zs), Generic (LimitType z)) => Generic (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

type Rep (LimitType (zs :. z)) :: Type -> Type #

Methods

from :: LimitType (zs :. z) -> Rep (LimitType (zs :. z)) x #

to :: Rep (LimitType (zs :. z)) x -> LimitType (zs :. z) #

(Eq a, Eq b) => Eq (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

(==) :: (a :. b) -> (a :. b) -> Bool #

(/=) :: (a :. b) -> (a :. b) -> Bool #

(Data a, Data b) => Data (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :. b) -> c (a :. b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :. b) #

toConstr :: (a :. b) -> Constr #

dataTypeOf :: (a :. b) -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :. b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :. b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :. b) -> a :. b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :. b) -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :. b) -> r #

gmapQ :: (forall d. Data d => d -> u) -> (a :. b) -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :. b) -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :. b) -> m (a :. b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :. b) -> m (a :. b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :. b) -> m (a :. b) #

(Ord a, Ord b) => Ord (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

compare :: (a :. b) -> (a :. b) -> Ordering #

(<) :: (a :. b) -> (a :. b) -> Bool #

(<=) :: (a :. b) -> (a :. b) -> Bool #

(>) :: (a :. b) -> (a :. b) -> Bool #

(>=) :: (a :. b) -> (a :. b) -> Bool #

max :: (a :. b) -> (a :. b) -> a :. b #

min :: (a :. b) -> (a :. b) -> a :. b #

(Read a, Read b) => Read (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

readsPrec :: Int -> ReadS (a :. b) #

readList :: ReadS [a :. b] #

readPrec :: ReadPrec (a :. b) #

readListPrec :: ReadPrec [a :. b] #

(Show a, Show b) => Show (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

showsPrec :: Int -> (a :. b) -> ShowS #

show :: (a :. b) -> String #

showList :: [a :. b] -> ShowS #

Generic (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

type Rep (a :. b) :: Type -> Type #

Methods

from :: (a :. b) -> Rep (a :. b) x #

to :: Rep (a :. b) x -> a :. b #

(Arbitrary a, Arbitrary b) => Arbitrary (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

arbitrary :: Gen (a :. b) #

shrink :: (a :. b) -> [a :. b] #

(NFData a, NFData b) => NFData (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

rnf :: (a :. b) -> () #

(Hashable a, Hashable b) => Hashable (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

hashWithSalt :: Int -> (a :. b) -> Int #

hash :: (a :. b) -> Int #

(ToJSON a, ToJSON b) => ToJSON (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

toJSON :: (a :. b) -> Value #

toEncoding :: (a :. b) -> Encoding #

toJSONList :: [a :. b] -> Value #

toEncodingList :: [a :. b] -> Encoding #

(ToJSON a, ToJSONKey a, ToJSON b, ToJSONKey b) => ToJSONKey (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

(FromJSON a, FromJSON b) => FromJSON (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

parseJSON :: Value -> Parser (a :. b) #

parseJSONList :: Value -> Parser [a :. b] #

(FromJSON a, FromJSONKey a, FromJSON b, FromJSONKey b) => FromJSONKey (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

(Binary a, Binary b) => Binary (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: (a :. b) -> Put #

get :: Get (a :. b) #

putList :: [a :. b] -> Put #

(Serialize a, Serialize b) => Serialize (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: Putter (a :. b) #

get :: Get (a :. b) #

(Unbox a, Unbox b) => Unbox (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

(SparseBucket i, SparseBucket is) => SparseBucket (is :. i) Source #

Manhattan distances add up.

Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

manhattan :: LimitType (is :. i) -> (is :. i) -> Int Source #

manhattanMax :: LimitType (is :. i) -> Int Source #

IndexStream z => IndexStream (z :. Boundary k2 I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSetClasses

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Boundary k2 I) -> LimitType (z :. Boundary k2 I) -> Stream m (z :. Boundary k2 I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Boundary k2 I) -> LimitType (z :. Boundary k2 I) -> Stream m (z :. Boundary k2 I) Source #

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

IndexStream z => IndexStream (z :. BitSet1 i O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i O) -> LimitType (z :. BitSet1 i O) -> Stream m (z :. BitSet1 i O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i O) -> LimitType (z :. BitSet1 i O) -> Stream m (z :. BitSet1 i O) Source #

IndexStream z => IndexStream (z :. BitSet1 i I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i I) -> LimitType (z :. BitSet1 i I) -> Stream m (z :. BitSet1 i I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i I) -> LimitType (z :. BitSet1 i I) -> Stream m (z :. BitSet1 i I) Source #

IndexStream z => IndexStream (z :. Int) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Int

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Int) -> LimitType (z :. Int) -> Stream m (z :. Int) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Int) -> LimitType (z :. Int) -> Stream m (z :. Int) Source #

IndexStream z => IndexStream (z :. PInt C p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt C p) -> LimitType (z :. PInt C p) -> Stream m (z :. PInt C p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt C p) -> LimitType (z :. PInt C p) -> Stream m (z :. PInt C p) Source #

IndexStream z => IndexStream (z :. PInt O p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt O p) -> LimitType (z :. PInt O p) -> Stream m (z :. PInt O p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt O p) -> LimitType (z :. PInt O p) -> Stream m (z :. PInt O p) Source #

IndexStream z => IndexStream (z :. PInt I p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt I p) -> LimitType (z :. PInt I p) -> Stream m (z :. PInt I p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt I p) -> LimitType (z :. PInt I p) -> Stream m (z :. PInt I p) Source #

IndexStream z => IndexStream (z :. PointL C) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL C) -> LimitType (z :. PointL C) -> Stream m (z :. PointL C) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL C) -> LimitType (z :. PointL C) -> Stream m (z :. PointL C) Source #

IndexStream z => IndexStream (z :. PointL O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL O) -> LimitType (z :. PointL O) -> Stream m (z :. PointL O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL O) -> LimitType (z :. PointL O) -> Stream m (z :. PointL O) Source #

IndexStream z => IndexStream (z :. PointL I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL I) -> LimitType (z :. PointL I) -> Stream m (z :. PointL I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL I) -> LimitType (z :. PointL I) -> Stream m (z :. PointL I) Source #

IndexStream z => IndexStream (z :. PointR O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR O) -> LimitType (z :. PointR O) -> Stream m (z :. PointR O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR O) -> LimitType (z :. PointR O) -> Stream m (z :. PointR O) Source #

IndexStream z => IndexStream (z :. PointR I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR I) -> LimitType (z :. PointR I) -> Stream m (z :. PointR I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR I) -> LimitType (z :. PointR I) -> Stream m (z :. PointR I) Source #

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

Subword C (complement)

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword C) -> LimitType (z :. Subword C) -> Stream m (z :. Subword C) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword C) -> LimitType (z :. Subword C) -> Stream m (z :. Subword C) Source #

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

Subword O (outside).

Note: streamUp really needs to use streamDownMk / streamDownStep for the right order of indices!

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword O) -> LimitType (z :. Subword O) -> Stream m (z :. Subword O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword O) -> LimitType (z :. Subword O) -> Stream m (z :. Subword O) Source #

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

Subword I (inside)

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword I) -> LimitType (z :. Subword I) -> Stream m (z :. Subword I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword I) -> LimitType (z :. Subword I) -> Stream m (z :. Subword I) Source #

IndexStream z => IndexStream (z :. Unit t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Unit

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Unit t) -> LimitType (z :. Unit t) -> Stream m (z :. Unit t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Unit t) -> LimitType (z :. Unit t) -> Stream m (z :. Unit t) Source #

(Index zs, Index z) => Index (zs :. z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

data LimitType (zs :. z) Source #

Methods

linearIndex :: LimitType (zs :. z) -> (zs :. z) -> Int Source #

fromLinearIndex :: LimitType (zs :. z) -> Int -> zs :. z Source #

size :: LimitType (zs :. z) -> Int Source #

inBounds :: LimitType (zs :. z) -> (zs :. z) -> Bool Source #

zeroBound :: zs :. z Source #

zeroBound' :: LimitType (zs :. z) Source #

totalSize :: LimitType (zs :. z) -> [Integer] Source #

showBound :: LimitType (zs :. z) -> [String] Source #

showIndex :: (zs :. z) -> [String] Source #

Field1 (((Z :. a) :. b) :. c) (((Z :. a') :. b) :. c) a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens (((Z :. a) :. b) :. c) (((Z :. a') :. b) :. c) a a' #

Field1 ((Z :. a) :. b) ((Z :. a') :. b) a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens ((Z :. a) :. b) ((Z :. a') :. b) a a' #

Field1 (Z :. a) (Z :. a') a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens (Z :. a) (Z :. a') a a' #

Field2 (((Z :. a) :. b) :. c) (((Z :. a) :. b') :. c) b b' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_2 :: Lens (((Z :. a) :. b) :. c) (((Z :. a) :. b') :. c) b b' #

Field2 ((Z :. a) :. b) ((Z :. a) :. b') b b' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_2 :: Lens ((Z :. a) :. b) ((Z :. a) :. b') b b' #

Field3 (((Z :. a) :. b) :. c) (((Z :. a) :. b) :. c') c c' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_3 :: Lens (((Z :. a) :. b) :. c) (((Z :. a) :. b) :. c') c c' #

newtype MVector s (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype MVector s (a :. b) = MV_StrictPair (MVector s (a, b))
type Rep (LimitType (zs :. z)) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

type Rep (LimitType (zs :. z)) = D1 ('MetaData "LimitType" "Data.PrimitiveArray.Index.Class" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons ":.." ('InfixI 'LeftAssociative 9) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (LimitType zs)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (LimitType z))))
type Rep (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

type Rep (a :. b) = D1 ('MetaData ":." "Data.PrimitiveArray.Index.Class" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons ":." ('InfixI 'LeftAssociative 3) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)))
newtype Vector (a :. b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype Vector (a :. b) = V_StrictPair (Vector (a, b))
data LimitType (zs :. z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

data LimitType (zs :. z) = !(LimitType zs) :.. !(LimitType z)

data a :> b infixr 3 Source #

A different version of strict pairs. Makes for simpler type inference in multi-tape grammars. We use :> when we have special needs, like non-recursive instances on inductives tuples, as used for set indices.

This one is infixr so that in a :> b we can have the main type in a and the specializing types in b and then dispatch on a :> ts with ts maybe a chain of :>.

Constructors

!a :> !b infixr 3 

Instances

Instances details
(Unbox a, Unbox b) => Vector Vector (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a :> b) -> m (Vector (a :> b)) #

basicUnsafeThaw :: PrimMonad m => Vector (a :> b) -> m (Mutable Vector (PrimState m) (a :> b)) #

basicLength :: Vector (a :> b) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a :> b) -> Vector (a :> b) #

basicUnsafeIndexM :: Monad m => Vector (a :> b) -> Int -> m (a :> b) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a :> b) -> Vector (a :> b) -> m () #

elemseq :: Vector (a :> b) -> (a :> b) -> b0 -> b0 #

(Unbox a, Unbox b) => MVector MVector (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

basicLength :: MVector s (a :> b) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a :> b) -> MVector s (a :> b) #

basicOverlaps :: MVector s (a :> b) -> MVector s (a :> b) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a :> b)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a :> b) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a :> b) -> m (MVector (PrimState m) (a :> b)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a :> b) -> Int -> m (a :> b) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a :> b) -> Int -> (a :> b) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a :> b) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a :> b) -> (a :> b) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a :> b) -> MVector (PrimState m) (a :> b) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a :> b) -> MVector (PrimState m) (a :> b) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a :> b) -> Int -> m (MVector (PrimState m) (a :> b)) #

(Eq a, Eq b) => Eq (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

(==) :: (a :> b) -> (a :> b) -> Bool #

(/=) :: (a :> b) -> (a :> b) -> Bool #

(Data a, Data b) => Data (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :> b) -> c (a :> b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :> b) #

toConstr :: (a :> b) -> Constr #

dataTypeOf :: (a :> b) -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :> b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :> b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :> b) -> a :> b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :> b) -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :> b) -> r #

gmapQ :: (forall d. Data d => d -> u) -> (a :> b) -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :> b) -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :> b) -> m (a :> b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :> b) -> m (a :> b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :> b) -> m (a :> b) #

(Ord a, Ord b) => Ord (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

compare :: (a :> b) -> (a :> b) -> Ordering #

(<) :: (a :> b) -> (a :> b) -> Bool #

(<=) :: (a :> b) -> (a :> b) -> Bool #

(>) :: (a :> b) -> (a :> b) -> Bool #

(>=) :: (a :> b) -> (a :> b) -> Bool #

max :: (a :> b) -> (a :> b) -> a :> b #

min :: (a :> b) -> (a :> b) -> a :> b #

(Read a, Read b) => Read (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

readsPrec :: Int -> ReadS (a :> b) #

readList :: ReadS [a :> b] #

readPrec :: ReadPrec (a :> b) #

readListPrec :: ReadPrec [a :> b] #

(Show a, Show b) => Show (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

showsPrec :: Int -> (a :> b) -> ShowS #

show :: (a :> b) -> String #

showList :: [a :> b] -> ShowS #

Generic (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

type Rep (a :> b) :: Type -> Type #

Methods

from :: (a :> b) -> Rep (a :> b) x #

to :: Rep (a :> b) x -> a :> b #

(NFData a, NFData b) => NFData (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

rnf :: (a :> b) -> () #

(Hashable a, Hashable b) => Hashable (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

hashWithSalt :: Int -> (a :> b) -> Int #

hash :: (a :> b) -> Int #

(ToJSON a, ToJSON b) => ToJSON (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

toJSON :: (a :> b) -> Value #

toEncoding :: (a :> b) -> Encoding #

toJSONList :: [a :> b] -> Value #

toEncodingList :: [a :> b] -> Encoding #

(FromJSON a, FromJSON b) => FromJSON (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

parseJSON :: Value -> Parser (a :> b) #

parseJSONList :: Value -> Parser [a :> b] #

(Binary a, Binary b) => Binary (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: (a :> b) -> Put #

get :: Get (a :> b) #

putList :: [a :> b] -> Put #

(Serialize a, Serialize b) => Serialize (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: Putter (a :> b) #

get :: Get (a :> b) #

(Unbox a, Unbox b) => Unbox (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype MVector s (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype MVector s (a :> b) = MV_StrictIxPair (MVector s (a, b))
type Rep (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

type Rep (a :> b) = D1 ('MetaData ":>" "Data.PrimitiveArray.Index.Class" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons ":>" ('InfixI 'RightAssociative 3) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b)))
newtype Vector (a :> b) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype Vector (a :> b) = V_StrictIxPair (Vector (a, b))

data Z Source #

Base data constructor for multi-dimensional indices.

Constructors

Z 

Instances

Instances details
Bounded Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

minBound :: Z #

maxBound :: Z #

Eq Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

(==) :: Z -> Z -> Bool #

(/=) :: Z -> Z -> Bool #

Data Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Z -> c Z #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Z #

toConstr :: Z -> Constr #

dataTypeOf :: Z -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Z) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Z) #

gmapT :: (forall b. Data b => b -> b) -> Z -> Z #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Z -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Z -> r #

gmapQ :: (forall d. Data d => d -> u) -> Z -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Z -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Z -> m Z #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Z -> m Z #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Z -> m Z #

Ord Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

compare :: Z -> Z -> Ordering #

(<) :: Z -> Z -> Bool #

(<=) :: Z -> Z -> Bool #

(>) :: Z -> Z -> Bool #

(>=) :: Z -> Z -> Bool #

max :: Z -> Z -> Z #

min :: Z -> Z -> Z #

Read Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Show Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

showsPrec :: Int -> Z -> ShowS #

show :: Z -> String #

showList :: [Z] -> ShowS #

Generic Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

type Rep Z :: Type -> Type #

Methods

from :: Z -> Rep Z x #

to :: Rep Z x -> Z #

Arbitrary Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

arbitrary :: Gen Z #

shrink :: Z -> [Z] #

NFData Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

rnf :: Z -> () #

Hashable Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

hashWithSalt :: Int -> Z -> Int #

hash :: Z -> Int #

ToJSON Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

FromJSON Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Binary Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: Z -> Put #

get :: Get Z #

putList :: [Z] -> Put #

Serialize Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

put :: Putter Z #

get :: Get Z #

Unbox Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

SparseBucket Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

IndexStream Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType Z -> LimitType Z -> Stream m Z Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType Z -> LimitType Z -> Stream m Z Source #

Index Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

data LimitType Z Source #

Vector Vector Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

MVector MVector Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Bounded (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Eq (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Data (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LimitType Z -> c (LimitType Z) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LimitType Z) #

toConstr :: LimitType Z -> Constr #

dataTypeOf :: LimitType Z -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LimitType Z)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LimitType Z)) #

gmapT :: (forall b. Data b => b -> b) -> LimitType Z -> LimitType Z #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LimitType Z -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LimitType Z -> r #

gmapQ :: (forall d. Data d => d -> u) -> LimitType Z -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LimitType Z -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LimitType Z -> m (LimitType Z) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LimitType Z -> m (LimitType Z) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LimitType Z -> m (LimitType Z) #

Read (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Show (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Generic (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

type Rep (LimitType Z) :: Type -> Type #

Methods

from :: LimitType Z -> Rep (LimitType Z) x #

to :: Rep (LimitType Z) x -> LimitType Z #

Field1 (((Z :. a) :. b) :. c) (((Z :. a') :. b) :. c) a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens (((Z :. a) :. b) :. c) (((Z :. a') :. b) :. c) a a' #

Field1 ((Z :. a) :. b) ((Z :. a') :. b) a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens ((Z :. a) :. b) ((Z :. a') :. b) a a' #

Field1 (Z :. a) (Z :. a') a a' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_1 :: Lens (Z :. a) (Z :. a') a a' #

Field2 (((Z :. a) :. b) :. c) (((Z :. a) :. b') :. c) b b' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_2 :: Lens (((Z :. a) :. b) :. c) (((Z :. a) :. b') :. c) b b' #

Field2 ((Z :. a) :. b) ((Z :. a) :. b') b b' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_2 :: Lens ((Z :. a) :. b) ((Z :. a) :. b') b b' #

Field3 (((Z :. a) :. b) :. c) (((Z :. a) :. b) :. c') c c' Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

_3 :: Lens (((Z :. a) :. b) :. c) (((Z :. a) :. b) :. c') c c' #

type Rep Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

type Rep Z = D1 ('MetaData "Z" "Data.PrimitiveArray.Index.Class" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons "Z" 'PrefixI 'False) (U1 :: Type -> Type))
newtype Vector Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype Vector Z = V_Z (Vector ())
data LimitType Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

data LimitType Z = ZZ
newtype MVector s Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

newtype MVector s Z = MV_Z (MVector s ())
type Rep (LimitType Z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

type Rep (LimitType Z) = D1 ('MetaData "LimitType" "Data.PrimitiveArray.Index.Class" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons "ZZ" 'PrefixI 'False) (U1 :: Type -> Type))

class Index i where Source #

Index structures for complex, heterogeneous indexing. Mostly designed for indexing in DP grammars, where the indices work for linear and context-free grammars on one or more tapes, for strings, sets, later on tree structures.

Associated Types

data LimitType i :: * Source #

Data structure encoding the upper limit for each array.

Methods

linearIndex :: LimitType i -> i -> Int Source #

Given a maximal size, and a current index, calculate the linear index.

fromLinearIndex :: LimitType i -> Int -> i Source #

Given a maximal size and a valid Int, return the index.

size :: LimitType i -> Int Source #

Given the LimitType, return the number of cells required for storage.

inBounds :: LimitType i -> i -> Bool Source #

Check if an index is within the bounds.

zeroBound :: i Source #

A lower bound of zero

zeroBound' :: LimitType i Source #

A lower bound of zero but for a LimitType i.

totalSize :: LimitType i -> [Integer] Source #

The list of cell sizes for each dimension. its product yields the total size.

showBound :: LimitType i -> [String] Source #

Pretty-print all upper bounds

showIndex :: i -> [String] Source #

Pretty-print all indices

Instances

Instances details
Index Int Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Int

Associated Types

data LimitType Int Source #

Index Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

data LimitType Z Source #

(Index zs, Index z) => Index (zs :. z) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Associated Types

data LimitType (zs :. z) Source #

Methods

linearIndex :: LimitType (zs :. z) -> (zs :. z) -> Int Source #

fromLinearIndex :: LimitType (zs :. z) -> Int -> zs :. z Source #

size :: LimitType (zs :. z) -> Int Source #

inBounds :: LimitType (zs :. z) -> (zs :. z) -> Bool Source #

zeroBound :: zs :. z Source #

zeroBound' :: LimitType (zs :. z) Source #

totalSize :: LimitType (zs :. z) -> [Integer] Source #

showBound :: LimitType (zs :. z) -> [String] Source #

showIndex :: (zs :. z) -> [String] Source #

Index (BitSet t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet0

Associated Types

data LimitType (BitSet t) Source #

Index (PointL t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Associated Types

data LimitType (PointL t) Source #

Index (PointR t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Associated Types

data LimitType (PointR t) Source #

Index (Subword t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Subword

Associated Types

data LimitType (Subword t) Source #

Index (Unit t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Unit

Associated Types

data LimitType (Unit t) Source #

Index (PInt t p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Associated Types

data LimitType (PInt t p) Source #

Index (Boundary i t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSetClasses

Associated Types

data LimitType (Boundary i t) Source #

Index (BitSet1 bnd ioc) Source #

NOTE We linearize a bitset as follows: we need 2^number-of-bits * number-of-bits elements. The first is due to having a binary set structure. The second is due to pointing to each of those elements as being the boundary. This overcommits on memory since only those bits can be a boundary bits that are actually set. Furthermore, in case no bit is set at all, then there should be no boundary. This is currently rather awkwardly done by restricting enumeration and mapping the 0-set to boundary 0.

| TODO The size calculations are off by a factor of two, exactly. Each bitset (say) 00110 has a mirror image 11001, whose elements do not have to be indexed. It has to be investigated if a version with exact memory bounds is slower in indexing.

Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Associated Types

data LimitType (BitSet1 bnd ioc) Source #

Methods

linearIndex :: LimitType (BitSet1 bnd ioc) -> BitSet1 bnd ioc -> Int Source #

fromLinearIndex :: LimitType (BitSet1 bnd ioc) -> Int -> BitSet1 bnd ioc Source #

size :: LimitType (BitSet1 bnd ioc) -> Int Source #

inBounds :: LimitType (BitSet1 bnd ioc) -> BitSet1 bnd ioc -> Bool Source #

zeroBound :: BitSet1 bnd ioc Source #

zeroBound' :: LimitType (BitSet1 bnd ioc) Source #

totalSize :: LimitType (BitSet1 bnd ioc) -> [Integer] Source #

showBound :: LimitType (BitSet1 bnd ioc) -> [String] Source #

showIndex :: BitSet1 bnd ioc -> [String] Source #

sizeIsValid :: Monad m => Word -> [[Integer]] -> ExceptT SizeError m CellSize Source #

Given the maximal number of cells (Word, because this is the pointer limit for the machine), and the list of sizes, will check if this is still legal. Consider dividing the Word by the actual memory requirements for each cell, to get better exception handling for too large arrays.

One list should be given for each array.

newtype SizeError Source #

In case totalSize or variants thereof produce a size that is too big to handle.

Constructors

SizeError String 

newtype CellSize Source #

The total number of cells that are allocated.

Constructors

CellSize Word 

Instances

Instances details
Bounded CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Enum CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Eq CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Integral CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Num CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Ord CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Real CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Show CellSize Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

class Index i => IndexStream i where Source #

Generate a stream of indices in correct order for dynamic programming. Since the stream generators require concatMap / flatten we have to write more specialized code for (z:.IX) stuff.

Methods

streamUp :: Monad m => LimitType i -> LimitType i -> Stream m i Source #

Generate an index stream using LimitTypes. This prevents having to figure out how the actual limits for complicated index types (like Set) would look like, since for Set, for example, the LimitType Set == Int provides just the number of bits.

This generates an index stream suitable for forward structure filling. The first index is the smallest (or the first indices considered are all equally small in partially ordered sets). Larger indices follow up until the largest one.

streamDown :: Monad m => LimitType i -> LimitType i -> Stream m i Source #

If streamUp generates indices from smallest to largest, then streamDown generates indices from largest to smallest. Outside grammars make implicit use of this. Asking for an axiom in backtracking requests the first element from this stream.

Instances

Instances details
IndexStream Int Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Int

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType Int -> LimitType Int -> Stream m Int Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType Int -> LimitType Int -> Stream m Int Source #

IndexStream Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType Z -> LimitType Z -> Stream m Z Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType Z -> LimitType Z -> Stream m Z Source #

IndexStream z => IndexStream (z :. Boundary k2 I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSetClasses

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Boundary k2 I) -> LimitType (z :. Boundary k2 I) -> Stream m (z :. Boundary k2 I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Boundary k2 I) -> LimitType (z :. Boundary k2 I) -> Stream m (z :. Boundary k2 I) Source #

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

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

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

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

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

IndexStream z => IndexStream (z :. BitSet1 i O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i O) -> LimitType (z :. BitSet1 i O) -> Stream m (z :. BitSet1 i O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i O) -> LimitType (z :. BitSet1 i O) -> Stream m (z :. BitSet1 i O) Source #

IndexStream z => IndexStream (z :. BitSet1 i I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i I) -> LimitType (z :. BitSet1 i I) -> Stream m (z :. BitSet1 i I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. BitSet1 i I) -> LimitType (z :. BitSet1 i I) -> Stream m (z :. BitSet1 i I) Source #

IndexStream z => IndexStream (z :. Int) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Int

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Int) -> LimitType (z :. Int) -> Stream m (z :. Int) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Int) -> LimitType (z :. Int) -> Stream m (z :. Int) Source #

IndexStream z => IndexStream (z :. PInt C p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt C p) -> LimitType (z :. PInt C p) -> Stream m (z :. PInt C p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt C p) -> LimitType (z :. PInt C p) -> Stream m (z :. PInt C p) Source #

IndexStream z => IndexStream (z :. PInt O p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt O p) -> LimitType (z :. PInt O p) -> Stream m (z :. PInt O p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt O p) -> LimitType (z :. PInt O p) -> Stream m (z :. PInt O p) Source #

IndexStream z => IndexStream (z :. PInt I p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt I p) -> LimitType (z :. PInt I p) -> Stream m (z :. PInt I p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PInt I p) -> LimitType (z :. PInt I p) -> Stream m (z :. PInt I p) Source #

IndexStream z => IndexStream (z :. PointL C) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL C) -> LimitType (z :. PointL C) -> Stream m (z :. PointL C) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL C) -> LimitType (z :. PointL C) -> Stream m (z :. PointL C) Source #

IndexStream z => IndexStream (z :. PointL O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL O) -> LimitType (z :. PointL O) -> Stream m (z :. PointL O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL O) -> LimitType (z :. PointL O) -> Stream m (z :. PointL O) Source #

IndexStream z => IndexStream (z :. PointL I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL I) -> LimitType (z :. PointL I) -> Stream m (z :. PointL I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointL I) -> LimitType (z :. PointL I) -> Stream m (z :. PointL I) Source #

IndexStream z => IndexStream (z :. PointR O) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR O) -> LimitType (z :. PointR O) -> Stream m (z :. PointR O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR O) -> LimitType (z :. PointR O) -> Stream m (z :. PointR O) Source #

IndexStream z => IndexStream (z :. PointR I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR I) -> LimitType (z :. PointR I) -> Stream m (z :. PointR I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. PointR I) -> LimitType (z :. PointR I) -> Stream m (z :. PointR I) Source #

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

Subword C (complement)

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword C) -> LimitType (z :. Subword C) -> Stream m (z :. Subword C) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword C) -> LimitType (z :. Subword C) -> Stream m (z :. Subword C) Source #

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

Subword O (outside).

Note: streamUp really needs to use streamDownMk / streamDownStep for the right order of indices!

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword O) -> LimitType (z :. Subword O) -> Stream m (z :. Subword O) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword O) -> LimitType (z :. Subword O) -> Stream m (z :. Subword O) Source #

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

Subword I (inside)

Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword I) -> LimitType (z :. Subword I) -> Stream m (z :. Subword I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Subword I) -> LimitType (z :. Subword I) -> Stream m (z :. Subword I) Source #

IndexStream z => IndexStream (z :. Unit t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Unit

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (z :. Unit t) -> LimitType (z :. Unit t) -> Stream m (z :. Unit t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (z :. Unit t) -> LimitType (z :. Unit t) -> Stream m (z :. Unit t) Source #

IndexStream (Z :. BitSet t) => IndexStream (BitSet t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet0

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (BitSet t) -> LimitType (BitSet t) -> Stream m (BitSet t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (BitSet t) -> LimitType (BitSet t) -> Stream m (BitSet t) Source #

IndexStream (Z :. PointL t) => IndexStream (PointL t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (PointL t) -> LimitType (PointL t) -> Stream m (PointL t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (PointL t) -> LimitType (PointL t) -> Stream m (PointL t) Source #

IndexStream (Z :. PointR t) => IndexStream (PointR t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (PointR t) -> LimitType (PointR t) -> Stream m (PointR t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (PointR t) -> LimitType (PointR t) -> Stream m (PointR t) Source #

IndexStream (Z :. Subword t) => IndexStream (Subword t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Subword

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (Subword t) -> LimitType (Subword t) -> Stream m (Subword t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (Subword t) -> LimitType (Subword t) -> Stream m (Subword t) Source #

IndexStream (Z :. Unit t) => IndexStream (Unit t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Unit

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (Unit t) -> LimitType (Unit t) -> Stream m (Unit t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (Unit t) -> LimitType (Unit t) -> Stream m (Unit t) Source #

IndexStream (Z :. PInt ioc p) => IndexStream (PInt ioc p) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.PhantomInt

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (PInt ioc p) -> LimitType (PInt ioc p) -> Stream m (PInt ioc p) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (PInt ioc p) -> LimitType (PInt ioc p) -> Stream m (PInt ioc p) Source #

IndexStream (Z :. Boundary k2 I) => IndexStream (Boundary k2 I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSetClasses

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (Boundary k2 I) -> LimitType (Boundary k2 I) -> Stream m (Boundary k2 I) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (Boundary k2 I) -> LimitType (Boundary k2 I) -> Stream m (Boundary k2 I) Source #

IndexStream (Z :. BitSet1 i t) => IndexStream (BitSet1 i t) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.BitSet1

Methods

streamUp :: forall (m :: Type -> Type). Monad m => LimitType (BitSet1 i t) -> LimitType (BitSet1 i t) -> Stream m (BitSet1 i t) Source #

streamDown :: forall (m :: Type -> Type). Monad m => LimitType (BitSet1 i t) -> LimitType (BitSet1 i t) -> Stream m (BitSet1 i t) Source #

Somewhat experimental lens support.

Operations for sparsity.

class SparseBucket sh where Source #

manhattan turns an index sh into a starting point within sparseIndices of the Sparse data structure. This should reduce the time required to search sparseIndices, because manhattanStart[manhattan sh] yields a left bound, while manhattanStart[manhattan sh +1] will yield an excluded right bound.

Uses the Manhattan distance.

TODO This should probably be moved into the Index module.

Methods

manhattan :: LimitType sh -> sh -> Int Source #

The manhattan distance for an index.

manhattanMax :: LimitType sh -> Int Source #

The maximal possible manhattan distance.

Instances

Instances details
SparseBucket Z Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Class

(SparseBucket i, SparseBucket is) => SparseBucket (is :. i) Source #

Manhattan distances add up.

Instance details

Defined in Data.PrimitiveArray.Index.Class

Methods

manhattan :: LimitType (is :. i) -> (is :. i) -> Int Source #

manhattanMax :: LimitType (is :. i) -> Int Source #

SparseBucket (PointL O) Source #

TODO Is this instance correct? Outside indices shrink?

Instance details

Defined in Data.PrimitiveArray.Index.Point

SparseBucket (PointL I) Source # 
Instance details

Defined in Data.PrimitiveArray.Index.Point