ο      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                          None!"%&/0569:;<=DIOQRTNone!"%&/0569:;<=DIOQRTPhantom type for  Complement indices.Phantom type for Outside indices.Phantom type for Inside indices.None!"%&/0569:;<=DIOQRT Strict pairs -- as in repa.fA different version of strict pairs. Makes for simpler type inference in multi-tape grammars. We use :>i 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 :>.$4Base data constructor for multi-dimensional indices.8lGenerate 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.9,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.:If 93 generates indices from smallest to largest, then : 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.;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.<WGiven a minimal size, a maximal size, and a current index, calculate the linear index.=jGiven an index element from the smallest subset, calculate the highest linear index that is *not* stored.>eGiven an index element from the largest subset, calculate the highest linear index that *is* stored.?SGiven smallest and largest index, return the number of cells required for storage.@'Check if an index is within the bounds.2 $%&'()*+,-/89:;<=>?@ABCDEFGHIJKLMO'B&A $%89:;@?<=>X /'&/'&/'&/'&/'&-,+*)($%OBAOBAOBAOBAOBAMLKJIHG;<=>?@899::FEDC" $%()*+,-/'&899::;<=>?@CDEFGHIJKLMOBA3 333None!"%&/0569:;<=DIOQRTRAn edge boundary as two Ints denoting the edge  From :-> To.]generic mk for streamUp /  streamDowna(TODO this is unbelievably slow right nowdEdgeBoundary C (complement)eEdgeBoundary O (outside).Note: streamUp really needs to use  streamDownMk / streamDownStep! for the right order of indices!fEdgeBoundary I (inside)RSTU[\]^_`abcdefghijklmnoq \[RSTU]^_`&RSTUq\[q\[q\[q\[q\[onmlkjihgfed]^_`cbaRSTU]^_`abcdefghijklmnoq\[None!"%&/0569:;<=DIOQRTtuvvuttuvNone!"%&/0569:;<=DIOQRTwA w 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.wxyz{|wxyz{|(wxyz{|wxyz{|None!"%&/0569:;<=BDIOQRT#A point in a right-linear grammars.QA point in a left-linear grammar. The syntactic symbol is in left-most position.+C"None!"%&/0569:;<=DIOQRTAssuming 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.FixedC 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^Masks are used quite often for different types of bitsets. We liberate them as a type family.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.PNote 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.uSet successor. The first argument is the lower set limit, the second the upper set limit, the third the current set.wSet predecessor. The first argument is the lower set limit, the second the upper set limit, the third the current set.A bitset with two interfaces.A bitset with one interface.Newtype for a bitset. We'd use Word*s but that requires more shape instances.TODO can we use Words now?(Declare the interface to match anything.+TODO needed? want to use later in ADPfusion.Declare the interface to be the end of a path.0Declare the interface to be the start of a path.eCertain 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.6 linearIndex explicitly maps BS1 0 whatever to 0.h      !"#$%&'()*+,-./0123456789:;<=>?@BEFGHIJKLMNOPQRSTUVX4 F E    !"#$%&'()GH             BBBBB@?>=<;:987 !65432"#$%10/.-&'(),+*XFEXFEXFEXFEXFEVUTSGRQPONMHLKJIV      !"#$%&'()*+,-./0123456789:;<=>?@BGHIJKLMNOPQRSTUVXFE None!"%&/0569:;<=DIOQRT`A subword wraps a pair of Int indices i,j with i<=j.sSubwords 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.l Create a  Subword t where t is inferred.pgeneric mk for streamUp /  streamDownw Subword C (complement)x Subword O (outside).Note: streamUp really needs to use  streamDownMk / streamDownStep! for the right order of indices!y Subword I (inside)`abcdjklmnopqrstuvwxyz{|}~kj`abcdlmnopqrs+`abcdkjkjkjkjkj~}|{lmnozyxwpqrsvut`abcdlmnopqrstuvwxyz{|}~kj None!"%&/0569:;<=DIOQRTNone!"%&/0569:;<=DIOQRTok F\'Bj E[&A $%89:;@?<=>RSTUwxyz{|   !%)GH`abcdlmno None!"%&/0569:;<=DIOQRT freezes a stack of tables.;Map a function over each element, keeping the shape intact..The core set of functions on immutable arrays.BReturns the bounds of an immutable array, again inclusive bounds:  [lb..ub] .MFreezes a mutable array an returns its immutable version. This operation is O(1)Q and both arrays share the same memory. Do not use the mutable array afterwards.HThaw an immutable array into a mutable one. Both versions share memory._Extract a single element from the array. Generally unsafe as not bounds-checking is performed.,Savely transform the shape space of a table..The core set of operations for monadic arrays.AReturn the bounds of the array. All bounds are inclusive, as in [lb..ub]+Given lower and upper bounds and a list of all$ elements, produce a mutable array.jCreates a new array with the given bounds with each element within the array being in an undefined state.5Creates a new array with all elements being equal to elm.$Reads a single element in the array.%Writes a single element in the array.Mutable version of an array.[Infix index operator. Performs minimal bounds-checking using assert in non-optimized code.1Returns true if the index is valid for the array.tConstruct a mutable primitive array from a lower and an upper bound, a default element, and a list of associations.&Return all associations from an array.XCreates an immutable array from lower and upper bounds and a complete list of elements.gCreates an immutable array from lower and upper bounds, a default element, and a list of associations.5Returns all elements of an immutable array as a list. None!"%&/0569:;<=DIOQRT None!"%&/0569:;<=DIOQRT; provides methods to fill all cells with a specific index sh# in a stack of non-terminal tables c.rRun the forward phase of algorithms. Is *really* unsafe for now if tables have different sizes, as in its broken.TODO Need to run min/max on the bounds for all tables, not just the last table. Otherwise we don't really need the distinction between save and unsafe. This will have to be in  runFillTables.None!"%&/0569:;<=DIOQRT'B\ Fk&A[ Ej $%89:;@?<=>RSTUwxyz{|   !%)GH`abcdlmnoNone!"%&/0569:;<=DIOQRT#Bounds-checked version of indexing.First, we check via inBoundsH, second we check if the linear index is outside of the allocated area.'B\ Fk&A[ Ej $%89:;@?<=>RSTUwxyz{|   !%)GH`abcdlmnoNone!"%&/0569:;<=DIOQRT NxN sized score matrices*TODO needs a vector with the column names!Get the distance between edges  (From,To).3If the initial node has a "distance", it'll be here(Get the name of the node at an row index+Get the name of the node at an column index!Number of rows in a score matrix.$Number of columns in a score matrix.Turns a  ScoreMatrixk for distances into one scaled by "temperature" for Inside/Outside calculations. Each value is scaled by k -> exp $ negate k / r * t3 where r = (n-1) * d d = mean of genetic distance3Node scores are turned directly into probabilities.7TODO Again, there is overlap and we should really have newtype Distance and friends.TODO (newtype Temperature = Temperature DoubleTODO fix for rows /= cols!!! Import data.#TODO Should be generalized because Lib-BiobaseBlast does almost the same thing. temperature  !!"#$%&'()*+,-./01234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~unopquvwnopquvwu      !"#$%vw&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU V V W X Y Z [ \ ] ^ _ ` a b c d n o p q e f g u v w h i j k l m n o p q r s t u u v w x y z { | } ~ u                                                                                     -PrimitiveArray-0.8.0.0-BVUiv779U7I8cOf4DtXnHh!Data.PrimitiveArray.Vector.CompatData.PrimitiveArray.Index.IOCData.PrimitiveArray.Index.Class&Data.PrimitiveArray.Index.EdgeBoundaryData.PrimitiveArray.Index.Int$Data.PrimitiveArray.Index.PhantomIntData.PrimitiveArray.Index.PointData.PrimitiveArray.Index.Set!Data.PrimitiveArray.Index.SubwordData.PrimitiveArray.Index.UnitData.PrimitiveArray.ClassData.PrimitiveArray.DenseData.PrimitiveArray.FillTablesData.PrimitiveArray.CheckedData.PrimitiveArray.ScoreMatrixData.PrimitiveArray.IndexData.PrimitiveArray&vector-0.11.0.0-6uB77qGCxR6GPLxI2sqsX3Data.Vector.Fusion.Bundle.SizeUnknownMaxExactSizeflattenCOI:.$fEq:.$fOrd:.$fShow:. $fGeneric:.:> V_StrictPair MV_StrictPair $fArbitrary:. $fNFData:.$fFromJSONKey:. $fToJSONKey:. $fHashable:. $fFromJSON:. $fToJSON:. $fSerialize:. $fBinary:.$fVectorVector:. D:R:Vector:.0$fMVectorMVector:. $fUnbox:.$fEq:>$fOrd:>$fShow:> $fGeneric:>$fRead:.ZV_StrictIxPairMV_StrictIxPair $fNFData:> $fHashable:> $fFromJSON:> $fToJSON:> $fSerialize:> $fBinary:>$fVectorVector:> D:R:Vector:>0$fMVectorMVector:> $fUnbox:>$fEqZ$fOrdZ$fReadZ$fShowZ $fGenericZ$fRead:> IndexStreamstreamUp streamDownIndex linearIndexsmallestLinearIndexlargestLinearIndexsizeinBoundsV_ZMV_Z $fIndex:> $fIndex:.$fIndexStreamZ$fIndexZ $fNFDataZ $fArbitraryZ $fHashableZ $fFromJSONZ $fToJSONZ $fSerializeZ $fBinaryZ$fVectorVectorZ D:R:VectorZ0$fMVectorMVectorZ$fUnboxZ EdgeBoundary:->fromEdgeBoundaryFstfromEdgeBoundarySnd$fEqEdgeBoundary$fOrdEdgeBoundary$fShowEdgeBoundary$fGenericEdgeBoundary$fReadEdgeBoundaryV_EdgeBoundaryMV_EdgeBoundary streamUpMk streamUpStep streamDownMkstreamDownStep$fSerialmEdgeBoundary$fArbitraryEdgeBoundary$fIndexStreamEdgeBoundary$fIndexStream:.$fIndexStream:.0$fIndexStream:.1$fIndexEdgeBoundary$fNFDataEdgeBoundary$fHashableEdgeBoundary$fToJSONKeyEdgeBoundary$fToJSONEdgeBoundary$fFromJSONKeyEdgeBoundary$fFromJSONEdgeBoundary$fSerializeEdgeBoundary$fBinaryEdgeBoundary$fVectorVectorEdgeBoundaryD:R:VectorEdgeBoundary0$fMVectorMVectorEdgeBoundary$fUnboxEdgeBoundary$fIndexStreamInt $fIndexIntPIntgetPIntpIntIpIntOpIntC $fReadPInt $fShowPInt$fEqPInt $fOrdPInt $fEnumPInt $fNumPInt$fIntegralPInt $fRealPInt $fGenericPInt $fDataPInt$fIxPIntV_PIntMV_PInt$fIndexStreamPInt$fIndexStreamPInt0$fIndexStreamPInt1 $fIndexPInt $fNFDataPInt$fHashablePInt$fToJSONKeyPInt $fToJSONPInt$fFromJSONKeyPInt$fFromJSONPInt$fSerializePInt $fBinaryPInt$fVectorVectorPIntD:R:VectorPInt0$fMVectorMVectorPInt $fUnboxPIntPointR fromPointRPointL fromPointLpointLIpointLOpointLC $fEqPointL $fOrdPointL $fReadPointL $fShowPointL$fGenericPointL $fEqPointR $fOrdPointR $fReadPointR $fShowPointR$fGenericPointRSPV_PointL MV_PointL$fSerialmPointL$fArbitraryPointL$fIndexStreamPointL $fIndexPointL$fNFDataPointL$fHashablePointL$fToJSONKeyPointL$fToJSONPointL$fFromJSONKeyPointL$fFromJSONPointL$fSerializePointL$fBinaryPointL$fVectorVectorPointLD:R:VectorPointL0$fMVectorMVectorPointL $fUnboxPointLV_PointR MV_PointR $fIndexPointR$fNFDataPointR$fHashablePointR$fToJSONPointR$fFromJSONPointR$fSerializePointR$fBinaryPointR$fVectorVectorPointRD:R:VectorPointR0$fMVectorMVectorPointR $fUnboxPointR ApplyMask applyMaskFixed getFixedMaskgetFixedMask SetPredSuccsetSuccsetPredBS2BS1BitSet getBitSetAnyLastFirstBoundary getBoundarybitSetIbitSetObitSetC$fToJSONKeyBitSet$fToJSONBitSet$fFromJSONKeyBitSet$fFromJSONBitSet$fShowBoundary $fEqBoundary $fOrdBoundary$fGenericBoundary $fNumBoundary $fEqBitSet $fOrdBitSet $fReadBitSet$fGenericBitSet$fFiniteBitsBitSet$fRankedBitSet $fNumBitSet $fBitsBitSet $fShowBS2 $fShowBS1 V_Boundary MV_Boundary streamUpBndMkstreamUpBndStepstreamDownBndMkstreamDownBndStep$fIndexStreamBoundary$fIndexBoundary$fNFDataBoundary$fHashableBoundary$fFromJSONBoundary$fToJSONBoundary$fSerializeBoundary$fBinaryBoundary$fVectorVectorBoundaryD:R:VectorBoundary0$fMVectorMVectorBoundary$fUnboxBoundaryV_BitSet MV_BitSet streamUpBsMkstreamUpBsStepstreamDownBsMkstreamDownBsStep streamUpBsIMkstreamUpBsIStepstreamDownBsIMkstreamDownBsIStepstreamUpBsIiMkstreamUpBsIiStepstreamDownBsIiMkstreamDownBsIiStep$fSetPredSuccBS2$fSetPredSuccBS1$fSetPredSuccBitSet$fIndexStreamBS2$fIndexStream:.2 $fIndexBS2$fIndexStreamBS1$fIndexStream:.3$fIndexStream:.4$fIndexStream:.5 $fIndexBS1$fIndexStreamBitSet$fIndexStream:.6$fIndexStream:.7$fIndexStream:.8 $fIndexBitSet$fNFDataBitSet$fHashableBitSet$fSerializeBitSet$fBinaryBitSet $fShowBitSet$fVectorVectorBitSetD:R:VectorBitSet0$fMVectorMVectorBitSet $fUnboxBitSetV_FixedMV_FixedtestBsSarbitraryBitSetMax$fArbitraryBS2$fArbitraryBS1$fArbitraryBitSet$fArbitraryFixed$fApplyMaskBS2$fApplyMaskBS1$fApplyMaskBitSet$fSetPredSuccFixed$fSetPredSuccFixed0$fSetPredSuccFixed1 $fNFDataFixed$fSerializeFixed $fBinaryFixed$fHashableFixed$fVectorVectorFixedD:R:VectorFixed0$fMVectorMVectorFixed $fUnboxFixed$fGenericFixed $fShowFixed $fReadFixed $fOrdFixed $fEqFixedSubword fromSubwordfromSubwordFstfromSubwordSnd $fEqSubword $fOrdSubword $fShowSubword$fGenericSubword $fReadSubword V_Subword MV_SubwordsubwordsubwordIsubwordOsubwordC$fSerialmSubword$fArbitrarySubword$fIndexStreamSubword$fIndexSubword$fNFDataSubword$fHashableSubword$fToJSONKeySubword$fToJSONSubword$fFromJSONKeySubword$fFromJSONSubword$fSerializeSubword$fBinarySubword$fVectorVectorSubwordD:R:VectorSubword0$fMVectorMVectorSubword$fUnboxSubwordUnit$fEqUnit $fOrdUnit $fShowUnit $fGenericUnit $fReadUnitV_UnitMV_Unit$fArbitraryUnit$fIndexStreamUnit $fIndexUnit $fNFDataUnit$fHashableUnit$fToJSONKeyUnit $fToJSONUnit$fFromJSONKeyUnit$fFromJSONUnit$fSerializeUnit $fBinaryUnit$fVectorVectorUnitD:R:VectorUnit0$fMVectorMVectorUnit $fUnboxUnit FreezeTablesFrozen freezeTables PrimArrayMapmap PrimArrayOpsbounds unsafeFreeze unsafeThaw unsafeIndextransformShape MPrimArrayOpsboundsM fromListMnewMnewWithMreadMwriteMMutArr! inBoundsM fromAssocsMassocsfromList fromAssocstoList$fFreezeTablesm:.$fFreezeTablesmZBoxedUnboxedMBoxedMUnboxed$fPrimArrayMapBoxedshee'$fPrimArrayOpsBoxedshelm$fMPrimArrayOpsBoxedshelm$fNFDataMutArrD:R:MutArrmBoxed0 $fNFDataBoxed$fHashableBoxed$fFromJSONBoxed $fToJSONBoxed$fSerializeBoxed $fBinaryBoxed$fPrimArrayMapUnboxedshee'$fPrimArrayOpsUnboxedshelm$fMPrimArrayOpsUnboxedshelm$fNFDataMutArr0D:R:MutArrmUnboxed0$fNFDataUnboxed$fHashableUnboxed$fFromJSONUnboxed$fToJSONUnboxed$fSerializeUnboxed$fBinaryUnboxed$fGenericMutArr$fGenericMutArr0 $fReadUnboxed $fShowUnboxed $fEqUnboxed$fGenericUnboxed $fReadBoxed $fShowBoxed $fEqBoxed$fGenericBoxed WriteCellunsafeWriteCell writeCellunsafeRunFillTables$fWriteCellm:.sh$fWriteCellmZsh ScoreMatrix scoreMatrix scoreNodesrowNamescolNames.!.nodeDist rowNameOf colNameOfnumRowsnumColslistOfRowNameslistOfColNames toPartMatrixfromFile$fEqScoreMatrix$fShowScoreMatrixData.Vector.Unboxed.BaseMVectorVector