h$fZE      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                None$#$'(./23589<>?PrimitiveArrayStrict pairs -- as in repa. PrimitiveArrayA 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 :>.PrimitiveArray4Base data constructor for multi-dimensional indices.4PrimitiveArray 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.5PrimitiveArray$The manhattan distance for an index.6PrimitiveArray(The maximal possible manhattan distance.7PrimitiveArrayGenerate 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.8PrimitiveArrayGenerate an index stream using ?s. 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.9PrimitiveArrayIf 83 generates indices from smallest to largest, then 9 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.:PrimitiveArray-The total number of cells that are allocated.<PrimitiveArrayIn case  totalSize? or variants thereof produce a size that is too big to handle.>PrimitiveArrayIndex 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.?PrimitiveArray7Data structure encoding the upper limit for each array.@PrimitiveArrayGiven a maximal size, and a current index, calculate the linear index.APrimitiveArray!Given a maximal size and a valid Int, return the index.BPrimitiveArray Given the ?2, return the number of cells required for storage.CPrimitiveArray'Check if an index is within the bounds.DPrimitiveArrayA lower bound of zeroEPrimitiveArrayA lower bound of zero but for a  LimitType i.FPrimitiveArrayThe list of cell sizes for each dimension. its product yields the total size.GPrimitiveArrayPretty-print all upper boundsHPrimitiveArrayPretty-print all indicesKPrimitiveArray#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._PrimitiveArrayManhattan distances add up.' I! J"  465798:;<=>HGFEDCA@B??K  >HGFEDCA@B?K<=:;79846533 3 3None$#$'(./23589<>?( xPrimitiveArray?Sum type of errors that can happen when using primitive arrays.|PrimitiveArray7The core set of operations for pure and monadic arrays.}PrimitiveArrayReturns the bounds of an immutable array, again inclusive bounds:  [lb..ub] .~PrimitiveArrayExtract a single element from the array. Generally unsafe as not bounds-checking is performed.PrimitiveArray-Index into immutable array, but safe in case sh is not part of the array.PrimitiveArray,Savely transform the shape space of a table.PrimitiveArrayReturn the bounds of the array. All bounds are inclusive, as in [lb..ub]. Technically not monadic, but rather working on a monadic array.PrimitiveArray+Given lower and upper bounds and a list of all# elements, produce a mutable array.PrimitiveArrayCreates a new array with the given bounds with each element within the array being in an undefined state.PrimitiveArray Variant of  that requires a fill structure. Mostly for special / sparse structures (hence the S, also to be interpreted as "safe", since these functions won't fail with sparse structures).PrimitiveArray5Creates a new array with all elements being equal to elm.PrimitiveArray Variant of PrimitiveArray$Reads a single element in the array.PrimitiveArray(Read from the mutable array, but return Nothing in case sh does not exist. This will allow streaming DP combinators to "jump" over missing elements.Should be used with Stream.Monadic.mapMaybe to get efficient code.PrimitiveArray%Writes a single element in the array.PrimitiveArray/Write into the mutable array, but if the index sh# does not exist, silently continue.PrimitiveArrayFreezes a mutable array an returns its immutable version. This operation is O(1) and both arrays share the same memory. Do not use the mutable array afterwards.PrimitiveArrayThaw an immutable array into a mutable one. Both versions share memory.PrimitiveArrayAssociate a fill structure with each type of array (dense, sparse, ...). Example: 2type instance FillStruc (Sparse w v sh e) = (w sh) associates the type (w sh)/, which is of the same type as the underlying w8 structure holding index information for a sparse array.PrimitiveArrayMutable version of an array.PrimitiveArrayInfix index operator. Performs minimal bounds-checking using assert in non-optimized code.(!) is rewritten from phase [1] onwards into an optimized form. Before, it uses a very slow form, that does bounds checking.PrimitiveArray.Return value at an index that might not exist.PrimitiveArray1Returns true if the index is valid for the array.PrimitiveArrayConstruct a mutable primitive array from a lower and an upper bound, a default element, and a list of associations.PrimitiveArrayInitialize an immutable array but stay within the primitive monad m.PrimitiveArray4Initialize an immutable array with a fill structure.PrimitiveArray!Safely prepare a primitive array.TODO Check if having a  instance degrades performance. (We should see this once the test with NeedlemanWunsch is under way).PrimitiveArray&Return all associations from an array.PrimitiveArray&Return all associations from an array.PrimitiveArrayCreates an immutable array from lower and upper bounds and a complete list of elements.PrimitiveArrayCreates an immutable array from lower and upper bounds, a default element, and a list of associations.PrimitiveArray5Returns all elements of an immutable array as a list.#xyz{|}~#|}~z{xyNone$#$'(./23589<>?+PrimitiveArray!Explicitly store the upper bound.PrimitiveArray#The hashtable to be updated / used.PrimitiveArrayHelper structure for the streamUp /  streamDown functionality.TODO this should be a recursively constructed hashtable, based on the shape of sh.PrimitiveArraySets valid keys, working within a primitive Monad. The valid keys should be a hashtable with all correct keys, but values set to something resembling a default value. A good choice will be akin to mzero.Internally, this function uses  unsafeCoerce to change the  PrimState" token held by the hash table to RealWord, from whatever it is.TODO setup the  hashedUpDown# part, once it is clear what to do.None$#$'(./23589<>?,C  None$#$'(./23589<>?-vPrimitiveArrayPhantom type for  Complement indices.PrimitiveArrayPhantom type for Outside indices.PrimitiveArrayPhantom type for Inside indices.None$#$'(./23589<>?8 PrimitiveArrayCertain 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.PrimitiveArrayWhenever we can not set the boundary we should have for a set, we use this pattern. All legal boundaries are >=01. We also need to set the undefined boundary to 0 , since the  linearIndex will use this value to add, which for empty sets would reduce to 0 - UndefBoundary === 0.PrimitiveArrayAssuming a bitset on bits [0 .. highbit]:, we can apply a mask that stretches out those bits over [0 .. higherBit] with highbit <= higherBit2. Any active interfaces are correctly set as well.PrimitiveArrayFixed allows us to fix some or all bits of a bitset, thereby providing  succ/pred* operations which are only partially free.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' .|. fPrimitiveArrayMasks are used quite often for different types of bitsets. We liberate them as a type family.PrimitiveArraySuccessor 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.PrimitiveArraySet successor. The first argument is the lower set limit, the second the upper set limit, the third the current set.PrimitiveArraySet predecessor. The first argument is the lower set limit, the second the upper set limit, the third the current set.PrimitiveArray(Declare the interface to match anything.+TODO needed? want to use later in ADPfusionPrimitiveArray.Declare the interface to be the end of a path.PrimitiveArray0Declare the interface to be the start of a path.PrimitiveArrayfor ? None$#$'(./23589<>?9lPrimitiveArrayNewtype for a bitset.Int integrates better with the rest of the framework. But we should consider moving to Word-based indexing, if possible.? None$#$'(./23589<>?=CPrimitiveArray*The bitset with one interface or boundary.PrimitiveArray/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.?  None$#$'(./23589<>?=? None$#$'(./23589<>?>PrimitiveArrayA  behaves exactly like an Int$, but has an attached phantom type p. In particular, the Index and  IndexStream$ instances are the same as for raw Ints.?  None%#$'(./23589<>?@[PrimitiveArrayA point in a left-linear grammar. The syntactic symbol is in left-most position.PrimitiveArray#A point in a right-linear grammars.PrimitiveArray6TODO Is this instance correct? Outside indices shrink??None$#$'(./23589<>?DOPrimitiveArrayA subword wraps a pair of Int indices i,j with i<=j.Subwords always yield the upper-triangular part of a rect-angular array. This gives the quite curious effect that (0,N) points to the `largest' index, while #(0,0) ... (1,1) ... (k,k) ... (N,N) point to the smallest. We do, however, use (0,0) as the smallest as (0,k) gives successively smaller upper triangular parts.PrimitiveArray Create a  Subword t where t is inferred.PrimitiveArraygeneric mk for streamUp /  streamDownPrimitiveArray Subword C (complement)PrimitiveArray Subword O (outside).Note: streamUp really needs to use  streamDownMk / streamDownStep! for the right order of indices!PrimitiveArray Subword I (inside)? None$#$'(./23589<>?D?None$#$'(./23589<>?E;I !J "  456789:;<=>HGFEDCA@?B?K?????None$#$'(./23589<>?FI! J"   456789:;<=>HGFEDCA@?B?Kxyz{|}~None$#$'(./23589<>?HPrimitiveArray#Bounds-checked version of indexing.First, we check via inBounds, second we check if the linear index is outside of the allocated area.I! J"   456789:;<=>HGFEDCA@?B?Kxyz{|}~I! J"   456789:;<=>HGFEDCA@?BKxyz{|}~None$#$'(./23589<>?RPrimitiveArrayThis is a sparse matrix, where only a subset of indices have data associated.PrimitiveArrayThe upper bound for the DP matrix. Not the upper bound of indexes in use, but the theoretical upper bound.PrimitiveArray#Vector with actually existing data.PrimitiveArrayThe index of each sh% is the same as of the corresponding  sparseData: structure. Indices should be ordered as required by the streamUp! function, to facilitate filling Sparse by going from left to right.PrimitiveArray$Provides left/right boundaries into  sparseIndices to speed up index search. Should be one larger than the largest index to look up, to always provides a good excluded bound.PrimitiveArray$Find the index with manhattan helperTODO consider using binary search instead of a linear scan here! e.g.: !k = VAS.binarySearchByBounds (==)+NOTE running times with 100x100 DP problem NeedlemanWunsch full findIndex of sixs: 0,050,000 cells/sec using manhattan buckets, findIndex: 5,000,000 cells/sec using binarySearch on slices: 11,000,000 cells/secOn a 1000x1000 DP NeedlemanWunsch problem, binary search on slices is at 6,500,000 cells/sec.PrimitiveArrayGiven two index vectors of the same shape, will return the correctly ordered vector of the union of indices.TODO This requires that  Ord (Shape O) uses the Down. instance of Ord! We need to fix this in the Index modules.TODO Rewrite to allow fusion without intermediate vectors using uncons. This will make it possible to chain applications. stream should be fine for this.PrimitiveArrayCurrently, our mutable variant of sparse matrices will keep indices and manhattan starts immutable as well. None%#$'(./23589<>?YPrimitiveArrayThis is a sparse matrix, where only a subset of indices have data associated.PrimitiveArrayThe upper bound for the DP matrix. Not the upper bound of indexes in use, but the theoretical upper bound.PrimitiveArray#Vector with actually existing data.PrimitiveArrayLinearly encoded sparse indicesPrimitiveArray$Provides left/right boundaries into  sparseIndices to speed up index search. Should be one larger than the largest index to look up, to always provides a good excluded bound.PrimitiveArray$Find the index with manhattan helperTODO consider using binary search instead of a linear scan here! e.g.: !k = VAS.binarySearchByBounds (==)+NOTE running times with 100x100 DP problem NeedlemanWunsch full findIndex of sixs: 0,050,000 cells/sec using manhattan buckets, findIndex: 5,000,000 cells/sec using binarySearch on slices: 11,000,000 cells/secOn a 1000x1000 DP NeedlemanWunsch problem, binary search on slices is at 6,500,000 cells/sec.PrimitiveArrayGiven two index vectors of the same shape, will return the correctly ordered vector of the union of indices.TODO This requires that  Ord (Shape O) uses the Down. instance of Ord! We need to fix this in the Index modules.TODO Rewrite to allow fusion without intermediate vectors using uncons. This will make it possible to chain applications. stream should be fine for this.PrimitiveArrayCurrently, our mutable variant of sparse matrices will keep indices and manhattan starts immutable as well. None$#$'(./23589<>?Z  !"#$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJKLMNOOPPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                                .PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJData.PrimitiveArray.IndexData.PrimitiveArray.Index.ClassData.PrimitiveArray.CheckedData.PrimitiveArray.ClassData.PrimitiveArray.HashTableData.PrimitiveArray.DenseData.PrimitiveArray.Index.IOC'Data.PrimitiveArray.Index.BitSetClasses!Data.PrimitiveArray.Index.BitSet0!Data.PrimitiveArray.Index.BitSet1Data.PrimitiveArray.Index.Int$Data.PrimitiveArray.Index.PhantomIntData.PrimitiveArray.Index.Point!Data.PrimitiveArray.Index.SubwordData.PrimitiveArray.Index.Unit$Data.PrimitiveArray.Sparse.BinSearch'Data.PrimitiveArray.Sparse.IntBinSearchTest.QuickCheck ArbitraryData.PrimitiveArrayData.PrimitiveArray.Sparse&vector-0.12.3.0-Iq8W8y7X87B1xSQfAcXis3Data.Vector.Unboxed.BaseVectorMVector:.$fEq:.$fOrd:.$fShow:. $fGeneric:.$fData:.:> V_StrictPair MV_StrictPair $fArbitrary:. $fNFData:.$fFromJSONKey:. $fToJSONKey:. $fHashable:. $fFromJSON:. $fToJSON:. $fSerialize:. $fBinary:.$fVectorVector:.$fMVectorMVector:. $fUnbox:.$fEq:>$fOrd:>$fShow:> $fGeneric:>$fData:>$fRead:.ZV_StrictIxPairMV_StrictIxPair $fNFData:> $fHashable:> $fFromJSON:> $fToJSON:> $fSerialize:> $fBinary:>$fVectorVector:>$fMVectorMVector:> $fUnbox:>$fEqZ$fOrdZ$fReadZ$fShowZ $fGenericZ$fDataZ $fBoundedZ$fRead:> SparseBucket manhattan manhattanMax IndexStreamstreamUp streamDownCellSize SizeErrorIndex LimitType linearIndexfromLinearIndexsizeinBounds zeroBound zeroBound' totalSize showBound showIndexV_ZMV_Z sizeIsValid$fField3:.:.cc'$fField2:.:.bb'$fField2:.:.bb'0$fField1:.:.aa'$fField1:.:.aa'0$fField1:.:.aa'1 $fNFDataZ $fArbitraryZ $fHashableZ $fFromJSONZ $fToJSONZ $fSerializeZ $fBinaryZ$fVectorVectorZ$fMVectorMVectorZ$fUnboxZ $fIndex:.$fIndexZ$fIndexStreamZ$fSparseBucket:.$fSparseBucketZ $fEqCellSize $fOrdCellSize$fShowCellSize $fNumCellSize$fBoundedCellSize$fIntegralCellSize$fRealCellSize$fEnumCellSize $fEqSizeError$fOrdSizeError$fShowSizeError$fBoundedLimitType$fDataLimitType$fShowLimitType$fReadLimitType$fGenericLimitType $fEqLimitType$fBoundedLimitType0$fDataLimitType0$fShowLimitType0$fReadLimitType0$fGenericLimitType0$fEqLimitType0PAErrors PAEUpperBound PrimArrayMapmapArray PrimArrayOps upperBound unsafeIndex safeIndextransformShape upperBoundM fromListMnewMnewSMnewWithM newWithSMreadM safeReadMwriteM safeWriteM unsafeFreezeM unsafeThawM FillStrucMutArr!!? inBoundsM fromAssocsM newWithPA newWithSPA safeNewWithPAassocsassocsSfromList fromAssocstoList$fShowPAErrors $fEqPAErrors$fGenericPAErrorsHashed_hashedUpperBound _hashedTable _hashedUpDown setValidKeysDense _denseLimit_denseVBoxedStorableUnboxedMDense denseLimitdenseV$fPrimArrayMapTYPEDenseshee'$fPrimArrayOpsDenseshe$fNFDataMutArr $fShowMutArr $fNFDataDense$fHashableDense$fFromJSONDense $fToJSONDense$fSerializeDense $fBinaryDense$fGenericMutArr $fDataDense$fFunctorDense $fShowDense $fReadDense$fGenericDense $fEqDenseCOIBoundary getBoundary UndefBoundary$fShowBoundary $fEqBoundary $fOrdBoundary$fGenericBoundary $fNumBoundary ApplyMask applyMask FixedMaskgetMaskgetFixedMask SetPredSuccsetSuccsetPredAnyLastFirst V_Boundary MV_Boundary streamUpBndMkstreamUpBndStepstreamDownBndMkstreamDownBndSteparbitraryBitSetMax$fIndexStreamBoundary$fIndexStream:.$fIndexBoundary$fNFDataBoundary$fHashableBoundary$fFromJSONBoundary$fToJSONBoundary$fSerializeBoundary$fBinaryBoundary$fVectorVectorBoundary$fMVectorMVectorBoundary$fUnboxBoundaryBitSet_bitSet $fEqBitSet $fOrdBitSet$fGenericBitSet$fFiniteBitsBitSet$fRankedBitSet $fNumBitSet $fBitsBitSetbitSet$fHashableBitSet$fSerializeBitSet$fBinaryBitSet$fToJSONKeyBitSet$fToJSONBitSet$fFromJSONKeyBitSet$fFromJSONBitSetV_BitSet MV_BitSet streamUpMk streamUpStep streamDownMkstreamDownStep$fArbitraryBitSet$fIndexStreamBitSet$fIndexStream:.0$fIndexStream:.1$fSetPredSuccBitSet $fIndexBitSet$fNFDataBitSet $fShowBitSet$fVectorVectorBitSet$fMVectorMVectorBitSet $fUnboxBitSetBitSet1_bitset _boundary $fEqBitSet1 $fOrdBitSet1$fGenericBitSet1 $fShowBitSet1bitsetboundary V_BitSet1 MV_BitSet1$fArbitraryBitSet1$fSetPredSuccFixedMask$fSetPredSuccBitSet1$fIndexStreamBitSet1$fIndexBitSet1$fVectorVectorBitSet1$fMVectorMVectorBitSet1$fUnboxBitSet1$fIndexStreamInt $fIndexIntPIntgetPIntpIntIpIntOpIntC $fReadPInt $fShowPInt$fEqPInt $fOrdPInt $fGenericPInt $fDataPInt$fIxPInt $fRealPInt $fNumPInt $fEnumPInt$fIntegralPIntV_PIntMV_PInt$fIndexStreamPInt $fIndexPInt $fNFDataPInt$fHashablePInt$fToJSONKeyPInt $fToJSONPInt$fFromJSONKeyPInt$fFromJSONPInt$fSerializePInt $fBinaryPInt$fVectorVectorPInt$fMVectorMVectorPInt $fUnboxPIntPointL fromPointLpointLIpointLOpointLC $fEqPointL $fOrdPointL $fReadPointL $fShowPointL$fGenericPointL $fNumPointLPointR fromPointRSPV_PointL MV_PointL$fSerialmPointL$fArbitraryPointL$fIndexStreamPointL $fIndexPointL$fNFDataPointL$fHashablePointL$fToJSONKeyPointL$fToJSONPointL$fFromJSONKeyPointL$fFromJSONPointL$fSerializePointL$fBinaryPointL$fVectorVectorPointL$fMVectorMVectorPointL $fUnboxPointL $fEqPointR $fOrdPointR $fReadPointR $fShowPointR$fGenericPointR $fNumPointRV_PointR MV_PointR arbMaxPointR$fSparseBucketPointL$fSparseBucketPointL0$fArbitraryPointR$fIndexStreamPointR$fIndexStream:.2$fIndexStream:.3 $fIndexPointR$fNFDataPointR$fHashablePointR$fToJSONKeyPointR$fToJSONPointR$fFromJSONKeyPointR$fFromJSONPointR$fSerializePointR$fBinaryPointR$fVectorVectorPointR$fMVectorMVectorPointR $fUnboxPointRSubword fromSubwordfromSubwordFstfromSubwordSnd $fEqSubword $fOrdSubword $fShowSubword$fGenericSubword $fReadSubword V_Subword MV_SubwordsubwordsubwordIsubwordOsubwordC$fSerialmSubword$fArbitrarySubword$fIndexStreamSubword$fIndexSubword$fNFDataSubword$fHashableSubword$fToJSONKeySubword$fToJSONSubword$fFromJSONKeySubword$fFromJSONSubword$fSerializeSubword$fBinarySubword$fVectorVectorSubword$fMVectorMVectorSubword$fUnboxSubwordUnit$fEqUnit $fOrdUnit $fShowUnit $fGenericUnit $fReadUnitV_UnitMV_Unit$fArbitraryUnit$fIndexStreamUnit $fIndexUnit $fNFDataUnit$fHashableUnit$fToJSONKeyUnit $fToJSONUnit$fFromJSONKeyUnit$fFromJSONUnit$fSerializeUnit $fBinaryUnit$fVectorVectorUnit$fMVectorMVectorUnit $fUnboxUnitSparsesparseUpperBound sparseData sparseIndicesmanhattanStartmanhattanIndex binarySearchmergeIndexVectors$fPrimArrayOpsSparseshe$fPrimArrayMapTYPESparseshee'ZZ:.. mtl-2.2.2Control.Monad.Error.Class MonadError LtBoundaryLtBitSet LtNumBits1LtIntLtPIntLtPointLLtPointR LtSubwordLtUnitD:R:MutArrmSparse0MSparsemmanhattanStartmsparseIndices msparseDatamsparseUpperBound