TO      None !"/25: B-tree file header represents an empty tree k f e is a B* tree of key type k with elements of type e2. Subtree references are contained within a type f.The  constructor contains a left child, and a list of key/child pairs where each child's keys are greater than or equal to the given key.!A tree leaf (e.g. key/value pair) a% is a reference to an object of type ar on disk. The offset does not include the header; e.g. the first object after the header is located at offset 0.5The maximum number of children of a B-tree inner node!The number of entries in a B-treeAn offset within the stream This only compares on the keys!This only compares on the keysA read-only B-tree for lookups"2It is critical that this encoding is of fixed size$#$%&'()*+, !-./0123456"78#$%&'()*./012345678#$%&'()*+, !-./0123456"78NoneAIterate over the leaves of the given tree in ascending key order.9VIterate over the nodes and leaves of the given tree. These aren't necessarily sorted.:9;9;:9;NoneRead a B-tree from a  ByteString produced by Open a B-tree file.Lookup a key in a B-tree. How many keys are in a .<  < NoneT ='nodes to be included in the active node>the length of dNodes?6the desired number of elements to fill the active node@BA Producer which accepts offsets for the yielded objects in returnARCompute the optimal node sizes for each stratum of a tree of given size and orderBGiven a producer of a known number of leaves, produces an optimal B-tree. Technically the size is only an upper bound: the producer may terminate before providing the given number of leaves although the resulting tree will break the minimal fill invariant.CbProduce a bytestring representing the nodes and leaves of the B-tree and return a suitable header #Build a B-tree into the given file.-As the name suggests, this requires that the Producer& emits leaves in ascending key order. Build a B-tree into  ByteString-As the name suggests, this requires that the Producer& emits leaves in ascending key order.This is primarily used for testing. In particular, note that this is a bad idea for large trees as the entire contents of the tree will need to be kept in memory until all leaves have been added so that the header can be prepended.DLike Pipes.Prelude.foldA but provides returns producer result in addition to accumulatorEF=>?@GHIJKLABCM  Order of treeMaximum tree size Output fileN of elements  Order of treeMaximum tree sizeN of elementsDGB EF=>?@GHIJKLABCM DNone BMerge trees' leaves taking ordered leaves from a set of producers.Each producer must be annotated with the number of leaves it is expected to produce. The size of the resulting tree will be at most the sum of these sizes. Merge several  LookupTreesnThis is a convenience function for merging several trees already on disk. For a more flexible interface, see  . Get a sized N suitable for   from a  merge operation on elementsorder of merged treename of output fileproducers of leaves to merge merge operation on elementsorder of merged treename of output filetrees to mergea treea sized N suitable for passing to     SafeOAn internal data structure placed at the very end of the file which describes the header and provides a magic number for sanity checking.PWrite the produced Q.s to the file followed by the returned headerRWrite the produced Q.s to the file followed by the returned headerSRead and verify the header from the file, then pass it along with the file's handle to an action. The file handle sits at the beginning of the written content when passed to the action. OTUVWXPRYZS[PS OTUVWXPRYZS[SafeT7A file containing a finite list of binary encoded itemsGet the path to the  BinaryList file&Encode the items of the given producerOpen a  file.#TODO: Sanity checking at open time.Stream the items out of a  BinaryList \]^_` \]^_` None:TalMaximum number of leaf lists to attempt to merge at once. This is bounded by the maximum file handle count.#Build a B-tree into the given file.This does not assume that the leaves are produced in order. Instead, the sorting is handled internally through a simple merge sort. Chunks of leaves are collected, sorted in memory, and then written to intermediate trees. At the end these trees are then merged.bJSplit the list into chunks of bounded size and run each through a functioncTake the first n elements and collect them in a Set . Return a N? which will emit the remaining elements (or the return value).adPath to scratch directoryMaximum chunk size Order of tree Output fileN of elementsePath to scratch directoryMaximum chunk sizeN of elementsbfgceadebfgcNone   h     !"#$%&'()*+,"-./01(23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW X YZ[\ ] ^ X 2 _ ` a b c deefgh i j k l m n op#b-tree-0.1.3-DBxFCvdSA8C4buq9GOyiH1BTreeBTree.BinaryList BTree.Types BTree.Walk BTree.LookupBuilder BTree.Builder BTree.MergeBTree.BinaryFileBTree.BuildUnorderedBLeafOrderSize LookupTree walkLeavesfromByteStringopenlookupsizefromOrderedToFilefromOrderedToByteString mergeLeaves mergeTreessizedProducerForTree BinaryListfilePath toBinaryListlengthstream$fBinaryHeader$fShowBinaryList $fShowHeaderfromUnorderedToFile BTreeHeader_btRootbaseGHC.BaseNothingNodeOnDiskOffset $fOrdBLeaf $fEqBLeaf$fBinaryBTreeHeader_btMagic _btVersion_btOrder_btSizeLeafmagic $fBinaryBTree $fBinaryBLeaf$fBinaryOnDisk_ltData _ltHeaderbtMagicbtOrderbtRootbtSize btVersionvalidateHeaderltDataltHeader walkNodes filterLeaveswalkNodesWithOffsetfetch_dNodes _dNodeCount _dMinFill DiskProducer optimalFill buildNodes buildTreefoldR DepthStateDepthSputBSBuildMdMinFill dNodeCountdNodesnext' dropUpstream"pipes-4.3.4-15Ul1roIBHW4TZnmZKIxZM Pipes.CoreProducerEpiloguewriteWithHeaderbytestring-0.10.8.1Data.ByteString.Lazy.Internal ByteStringhWriteWithHeaderreadWithHeader headerLen epiLength magicNumberannotaterunGetT$fBinaryEpilogueHeader hdrLengthBinList withHeader maxChunkMerge splitChunks takeChunk tempFilePathfromUnorderedToList throwLeft mergeLists