#^      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 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 [ \ ] Safe^+Open the specified file in read-write mode._<Write **at most** the specified amount of bytes to a handle.`=Read **at most** the specified amount of bytes from a handle.PReturn the amount of bytes actually read, or throw an IO error (including EOF).a&Synchronize the file contents to disk.bSeek to an absolute position.c%Set the filesize to a certain length.d2Get the filesize. This **edits the file pointer**.e Close a file.f2Read the lock and break it if the process is dead.g4Read the lock and return the process id if possible.h\Is this a permission error? If so we don't have permission to remove the lock file, abort.iHWe have determined the locking process is gone, try to remove the lock.jvAn exception when we tried to break a lock, if it says the lock file has already disappeared we are still good to go.kTry to create lock by opening the file with the O_EXCL flag and writing our PID into it. Verify by reading the pid back out and matching, maybe some other process slipped in before we were done and broke our lock.l:An exception saying the data is locked by another process.m<An exception saying we don't have permission to create lock.nSAn exception saying another process broke our lock before we finished creating it.oBRelinquish the lock by removing it and then verifying the removal.pqrs^_`abcdetfghuvijklmno pr^_`abcdetopqrs^_`abcdetfghuvijklmnoNone*wxywxywxySafe0zException raised when { is improperly used.{A reentrant lock.|Create a new reentrant lock.}!Acquire a reentrant lock, blocks.~Release a reentrant lock.:Execute an action with the lock, bracketed, exception-safez{|}~z{|}~z{|}~SafeSafeNoneNone,09;<=?RData type which encodes the integer using a variable amount of NULL or ONE bytes.;A storage back-end that can store and fetch physical pages./Open a database handle for reading and writing.:Flush the contents of a handle to disk (or other storage).Close a database handle.*Remove a handle from the storage back-end. A function that calculates the hypothetical size of a node, if it were to be written to a page (regardless of the maximum page size). /The maximum page size the allocator can handle. Get the maximum key size0The default implementation will repeatedly call A. You might want to cache this value in your own implementation. Get the maximum value size0The default implementation will repeatedly call A. You might want to cache this value in your own implementation. YRead a page and return the actual node and the transaction id when the node was written. Write a node to a physical page."Read a value from an overflow page!Write a value to an overflow page7List overflow pages in the specific overflow directory.The result should include **AT LEAST** the handles in the specified directory, but it may contain more handles, even handles that do not belong to an overflow page.Calculate the maximum key size.oReturn the size for which at least 4 key-value pairs with keys and values of that size can fit in a leaf node.!Calculate the maximum value size.Return the size for which at least 4 key-value pairs of the specified maximum key size and values of the returned size can fit in a leaf node. that size can fit in a leaf node.NSearch an arbitrary number, less than a limit, greater than a starting value. Maximum pages size0Function that calculates the page size of a nodeMaximum key sizeMaximum page sizeMaximum key size0Function that calculates the page size of a nodeMaximum value size      None  None@A committed or aborted transaction, with a return value of type a. 0Commit the new tree and return a computed value.!5Commit the new tree, without return a computed value."2Abort the transaction and return a computed value.#:Abort the transaction, without returning a computed value. !"# !"# !"# !"#None%&[$0the subtree structure of the free page database.Just a collection of free s.%2The main tree structure of the free page database.(The main free page database tree maps a  to a $.&!Replace the subtree of a certain .' Delete the subtree of a certain .The > will not be present anymore in the free tree after this call.(Insert a subtree for a certain .$%&'($%&'(%$&'($%&'(None %&,/9:;DIOT\ )Wrapper around E indicating that it is an overflow page from a previous transaction.+Wrapper around  indicating that it is dirty.-bA sum type repesenting any type of free page, that can immediately be used to write something to.1Wrapper around H indicating it wa fetched from the free database and is actually dirty.3Wrapper around J inidcating it was fetched from the free database and is ready for reuse.5Wrapper around 1 indicating the page is dirty and free for reuse.7Wrapper around  indicating it is a dirty page.9Wrapper around M indicating it is newly free'd and cannot be reused in the same transaction.;Wrapper around F indicating it is a fresh page, allocated at the end of the database.B#State of the file with index nodes.C'State of the file with data/leaf nodes.D?Used to turn of querying the free page database for free pages.E3Newly allocated overflow pages in this transaction.FJCounts how many overflow pages were already allocated in this transaction.GfOld overflow pages that were removed in this transaction and should be deleted when no longer in use.JYPages free'd in this transaction, not ready for reuse until the transaction is commited.KJThe original number of pages in the file, before the transaction started.L/The new uncommited number of pages in the file.All pages in the range K to L? (excluding) are freshly allocated in the ongoing transaction.MUPages freshly allocated AND free'd in this transaction. Immediately ready for reuse.N=The root of the free tree, might change during a transaction.O3All pages queried from the free page database for Q!, and actually used once already.PJPages queried from the free pages database and ready for immediate reuse.QThe  of the pages in P, or 6 if no pages were queried yet from the free database.UcWrapper around a type to indicate it belongs to a file with either data/leaf nodes or index nodes.\Create a new writer.^/Try to free a page, given a set of dirty pages.If the page was dirty, a 5- page is added to the environment, if not a 9" page is added to the environment.Btw, give me lenses...`Get a 7, page, by first proving it is in fact dirty.aGet a 1< page, by first proving it is in fact a dirty old free page.b"Touch a fresh page, make it dirty.We really need lenses...c-Touch a fresh overflow page, making it dirty.d"Get the type of the overflow page.eFree an old overflow page.@)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh=)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde@XYZUVWhgf[RSTHIJKLMNOPQ=>?@ABCDEFG\;<9:78563412-./0]^_`ab+,)*cde)*+,-./0123456789:;<= >?@ABCDEFGH IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghNone%&:OT[EAuxiliry type to ensure the transaction ID of free pages are checked.Get a free page.wFirst try to get one from the in-memory dirty pages. Then try to get one from the in-memory free page cache stored in writerReusablePagesC. If that one is empty, actually query one from the free database.Get a free'd dirty page.\Get a free'd dirty page, that is immediately suitable for reuse in the current transaction.Get a cached free page.7Get a free page from the free database cache stored in writerReusablePages.Try to get a list of free pages from the free page database, return the first free one for immediate use, and store the rest in the environment.This function will delete the lastly used entry from the free database, query a new one, and then update the free page cache in the state.This function only works when D is .This function expects writerReusablePages to be empty.ULookup a list of free pages from the free page database, guaranteed to be old enough.8Lookup a list of free pages from the free page database.DCheck the transaction ID of the free pages, if it's to old, return . NoneFSave the free pages from the dirty page list and the free page cache.DSave the newly free pages of the current transaction, as stored by writerNewlyFreedPages.1Save the free apges from the free page cache in writerReusablePages using writerReuseablePagesTxId.None%&:[5The subtree structure of the freed overflow page tree7The main tree structure of the freed overflow page tree?Save a set of overflow ids that were free'd in the transaction.CDelete the set of overflow ids that were free'd in the transaction. None,/5:<=DA class representing the storage requirements of the page allocator.JA store supporting the page allocator should be an instance of this class.0Write the meta-data structure to a certain page.=Try to read the meta-data structure from a handle, or return , if the handle doesn't contain a meta page. Meta data of the page allocator.DData type used to point to the most recent version of the meta data.  None %&9:;IOT[\/Monad in which page allocations can take place.The monad has access to a K back-end which manages can store and retreive the corresponding metadata.All necessary database handles.Construct a set of  from a root directory.Run the actions in an . monad, given a reader or writer environment.Evaluate the actions in an . monad, given a reader or writer environment.  None!":OT[An active concurrent database.#This can be shared amongst threads.Open all concurrent handles.7Open a new concurrent database, with the given handles.6Open the an existing database, with the given handles."Close the handles of the database.DCreate a new concurrent database with handles and metadata provided.Get the current meta data.BWrite the new metadata, and switch the pointer to the current one.+Execute a write transaction, with a result.DExecute a write transaction, without cleaning up old overflow pages..Execute a write transaction, without a result. Execute a read-only transaction.bRun a write action that takes the current meta-data and returns new meta-data to be commited, or - if the write transaction should be aborted.<Cleanup after an exception occurs, or after a program crash.The - of the aborted transaction should be passed.?Remove all overflow pages that were written in the transaction.CIf the transaction is aborted, all written pages should be deleted..Update the meta-data from a writer environmentBSave the newly free'd overflow pages, for deletion on the next tx./Save the free'd pages to the free page databaseHandle the dirty pages.FSave the newly created free dirty pages to the metadata for later use.Update the database size.None+ !"#$ None %&,0:ADT[/Exception thrown when decoding of a page fails.A decoder with its type."A decoded page, of a certain type t of kind .The type of a page.Get the type of a .GEncode a page to a lazy byte string, but with the checksum set to zero.IEncode a page to a lazy byte string, and prepend the calculated checksum.=Prepend the xxHash 64-bit checksum of a bytestring to itself.EEncode a page to a lazy byte string, without prepending the checksum.)Size of a node, if it were to be encoded.'Decode a page, and verify the checksum.;Decode a page with a specific decoder, or return the error.Monadic wrapper around The encoder of a .Decoder for an empty page.Decoder for a leaf node page.Decoder for a leaf node page.Decoder for an overflow page.(    &  (        None%&,09:;<=AIT[CException thrown when a value from an overflow page cannot be cast. As used in .>Exception thrown when a node cannot be cast to the right type. As used in  .:Exception thrown when a page that is too large is written. As used in .<Exception thrown when a file is accessed that doesn't exist.File store configuration.3The default configuration can be obtained by using  DA configuration with a specific page size can be obtained by using !.9Monad in which on-disk storage operations can take place.Two important instances are $ making it a storage back-end, and M making it a storage back-end compatible with the concurrent page allocator.6A collection of files, each associated with a certain fp handle.Each file is a Handle opened in . and contains a collection of physical pages.1These files can be safely shared between threads.0Encode a page padding it to the maxim page size.Return 4 of the page is too large to fit into one page size.Access the files.Modify the files. The default configurationThis is an unwrapped !! with a page size of 4096 bytes.!1Create a configuration with a specific page size.5The maximum key and value sizes are calculated using  and .If the page size is too small,  is returned.""Run the storage operations in the * monad, given a collection of open files.#(An empty file store, with no open files. !"Action Configuration Open files#$%&'() !"# !"# !"#$%&'() None%&-09:;<=AIT[7CException thrown when a value from an overflow page cannot be cast. As used in .9>Exception thrown when a node cannot be cast to the right type. As used in  .;<Exception thrown when a page that is accessed doesn't exist.=<Exception thrown when a file is accessed that doesn't exist.?Memory store configuration.3The default configuration can be obtained by using G.DA configuration with a specific page size can be obtained by using H.D8Monad in which binary storage operations can take place.Two important instances are % making it a storage back-end, and N making it a storage back-end compatible with the concurrent page allocator.EA collection of File"s, each associated with a certain fp handle.+This is shareable amongst multiple threads.F(A file containing a collection of pages.Access the files.Access the files.Modify the files.GThe default configuration.This is an unwrapped H with a page size of 4096.H1Create a configuration with a specific page size.5The maximum key and value sizes are calculated using  and .If the page size is too small,  is returned.I"Run the storage operations in the D monad, given a collection of Files.J;Construct a store with an empty database with name of type hnd.!789:;<=>?@ABCDEFGHI Action to run ConfigurationDataJKLMNOP789:;<=>?@ABCDEFGHIJFE?@ABCGHDIJ=>;<9:78789:;<=>?@ABCDEFGHIJKLMNOP !"#$%&'()*+,-./0123456789:;<=>?@@AABCDEFFGGHHIIJJKKLLMNOPQRSTUVVWXYZ[\]^__`abcdefghijklmnopqrstuvwxyz{|}~                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6     7 7   8 8 9 : ; < = > ? @ A B $ % C ' D E F G H I J K L M N 3 O 5 6PQRSTUVWXYZ[\]^_`abbccdefghijklmnojpqrstuvwxvwyvwz{|}~         <   %haskey-0.1.0.0-Bj1GeZXJASRBI49cDY743ODatabase.Haskey.Store.Class!Database.Haskey.Alloc.Transaction/Database.Haskey.Alloc.Concurrent.FreePages.Tree,Database.Haskey.Alloc.Concurrent.Environment0Database.Haskey.Alloc.Concurrent.FreePages.Query/Database.Haskey.Alloc.Concurrent.FreePages.Save)Database.Haskey.Alloc.Concurrent.Overflow%Database.Haskey.Alloc.Concurrent.Meta&Database.Haskey.Alloc.Concurrent.Monad)Database.Haskey.Alloc.Concurrent.DatabaseDatabase.Haskey.Store.PageDatabase.Haskey.Store.FileDatabase.Haskey.Store.InMemoryFileIODatabase.Haskey.Utils.STM.MapDatabase.Haskey.Utils.RLock!Database.Haskey.Utils.Monad.CatchDatabase.Haskey.Utils.MonadDatabase.Haskey.Utils.IODatabase.Haskey.Store Database.Haskey.Alloc.Concurrent System.IO ReadWriteMode ZeroEncodedgetZeroEncodedgetZeroEncodedValueStoreM openHandle flushHandle closeHandle removeHandle nodePageSize maxPageSize maxKeySize maxValueSize getNodePage putNodePage getOverflow putOverflow listOverflowscalculateMaxKeySizecalculateMaxValueSizearbitrarySearch$fValueZeroEncoded$fKeyZeroEncoded$fBinaryZeroEncoded$fStoreMhndReaderT$fStoreMhndStateT$fEqZeroEncoded$fOrdZeroEncoded$fShowZeroEncoded TransactionCommitAbortcommitcommit_abortabort_ FreeSubtreeFreeTreereplaceSubtree deleteSubtree insertSubtree OldOverflow DirtyOverflow SomeFreePage FreshFreePage DirtyFreePage OldFreePage DirtyOldFreeOldFree DirtyFreeDirty NewlyFreedFresh WriterEnv writerHnds writerTxId writerReaderswriterIndexFileStatewriterDataFileStatewriterReusablePagesOnwriterDirtyOverflowswriterOverflowCounterwriterRemovedOverflows FileStatefileStateNewlyFreedPagesfileStateOriginalNumPagesfileStateNewNumPagesfileStateFreedDirtyPagesfileStateFreeTreefileStateDirtyReusablePagesfileStateReusablePagesfileStateReusablePagesTxId ReaderEnv readerHndsS DataState IndexState StateTypeTypeData TypeIndex getSValue newWritergetSomeFreePageIdfreePageupdateFileStatedirty dirtyOldFree touchPage touchOverflow overflowTyperemoveOldOverflow $fFunctorS $fBinaryS $fBinaryS0 $fEqFresh $fOrdFresh $fShowFresh$fEqNewlyFreed$fOrdNewlyFreed$fShowNewlyFreed $fEqDirty $fOrdDirty $fShowDirty$fBinaryDirtyFree $fEqDirtyFree$fOrdDirtyFree$fShowDirtyFree $fEqOldFree $fOrdOldFree $fShowOldFree$fEqDirtyOldFree$fOrdDirtyOldFree$fShowDirtyOldFree$fEqDirtyOverflow$fOrdDirtyOverflow$fShowDirtyOverflow$fEqOldOverflow$fOrdOldOverflow$fShowOldOverflow$fShowS Unchecked getFreePageIdgetFreedDirtyPageIdgetCachedFreePageIdqueryNewFreePageIdslookupValidFreePageIdslookupFreePageIdscheckFreePages saveFreePagessaveNewlyFreedPagessaveCachedFreePagesOverflowSubtree OverflowTreegetNewOverflowIdgetOverflowHandlegetOverflowDirreadOverflowIdshowHex'readHex'insertOverflowIdsdeleteOverflowIdsdeleteOutdatedOverflowIdsConcurrentMetaStoreMputConcurrentMetareadConcurrentMetaConcurrentMetaconcurrentMetaRevisionconcurrentMetaDataNumPagesconcurrentMetaIndexNumPagesconcurrentMetaTreeconcurrentMetaDataFreeTreeconcurrentMetaIndexFreeTreeconcurrentMetaOverflowTree"concurrentMetaDataFreshUnusedPages#concurrentMetaIndexFreshUnusedPagesCurrentMetaPageMeta1Meta2$fBinaryConcurrentMeta$fGenericConcurrentMeta$fShowConcurrentMeta ConcurrentTfromConcurrentTConcurrentHandlesconcurrentHandlesDataconcurrentHandlesIndexconcurrentHandlesMetadata1concurrentHandlesMetadata2concurrentHandlesOverflowDirconcurrentHandlesrunConcurrentTevalConcurrentT readOverflow' getWriterHnd getReaderHnd$fAllocReaderMConcurrentT$fAllocReaderMConcurrentT0$fAllocMConcurrentT$fMonadTransConcurrentT$fShowConcurrentHandles$fFunctorConcurrentT$fApplicativeConcurrentT$fMonadConcurrentT$fMonadIOConcurrentT$fMonadThrowConcurrentT$fMonadCatchConcurrentT$fMonadMaskConcurrentT$fMonadStateConcurrentT ConcurrentDbconcurrentDbHandlesconcurrentDbWriterLockconcurrentDbCurrentMetaconcurrentDbMeta1concurrentDbMeta2concurrentDbReadersopenConcurrentHandlescreateConcurrentDbopenConcurrentDbcloseConcurrentHandlesnewConcurrentDbgetCurrentMetasetCurrentMetatransact transactNow transact_transactReadOnly actAndCommitcleanupAfterExceptionremoveNewlyAllocatedOverflows updateMetasaveOverflowIdssaveFreePages'handleFreedDirtyPages DecodeErrorSGetPage EmptyPageConcurrentMetaPage OverflowPage LeafNodePage IndexNodePage SPageType STypeEmptySTypeConcurrentMeta STypeOverflow STypeLeafNodeSTypeIndexNodePageType TypeEmptyTypeConcurrentMeta TypeOverflow TypeLeafNode TypeIndexNodepageTypeencodeZeroChecksumencodeprependChecksumencodeNoChecksumencodedPageSizedecodedecodeNoChecksumdecodeMputPage emptyPage leafNodePage indexNodePage overflowPageconcurrentMetaPage checksumSeed$fExceptionDecodeError$fBinaryPageType $fEqPageType$fShowPageType$fShowDecodeErrorWrongOverflowValueErrorWrongNodeTypeErrorPageOverflowErrorFileNotFoundErrorFileStoreConfigfileStoreConfigPageSizefileStoreConfigMaxKeySizefileStoreConfigMaxValueSize FileStoreTFiles encodeAndPaddefFileStoreConfigfileStoreConfigWithPageSize runFileStoreT newFileStore"$fExceptionWrongOverflowValueError$fExceptionWrongNodeTypeError$fExceptionPageOverflowError$fExceptionFileNotFoundError $fConcurrentMetaStoreMFileStoreT$fStoreM[]FileStoreT$fShowFileStoreConfig$fApplicativeFileStoreT$fFunctorFileStoreT$fMonadFileStoreT$fMonadIOFileStoreT$fMonadThrowFileStoreT$fMonadCatchFileStoreT$fMonadMaskFileStoreT$fMonadReaderFileStoreT$fShowFileNotFoundError$fShowPageOverflowError$fShowWrongNodeTypeError$fShowWrongOverflowValueErrorPageNotFoundErrorMemoryStoreConfigmemoryStoreConfigPageSizememoryStoreConfigMaxKeySizememoryStoreConfigMaxValueSize MemoryStoreT MemoryFiles MemoryFiledefMemoryStoreConfigmemoryStoreConfigWithPageSizerunMemoryStoreTnewEmptyMemoryStore$fExceptionPageNotFoundError"$fConcurrentMetaStoreMMemoryStoreT$fStoreMfpMemoryStoreT$fShowMemoryStoreConfig$fApplicativeMemoryStoreT$fFunctorMemoryStoreT$fMonadMemoryStoreT$fMonadIOMemoryStoreT$fMonadThrowMemoryStoreT$fMonadCatchMemoryStoreT$fMonadMaskMemoryStoreT$fMonadReaderMemoryStoreT$fShowPageNotFoundError openReadWritewritereadflushseek setFileSize getFileSizeclose checkLockreadLockcheckReadFileError breakLockcheckBreakErrortakeLocklockedBycantLock stolenLockreleasePrefixLockFHandle PrefixLockobtainPrefixLockmaybeBreakLockdoesProcessExist lookupMin lookupMinKeyalter RLockErrorRLocknewRLock acquireRLock releaseRLock withRLock$fExceptionRLockErrorjustErrMifMreadByteStringwriteByteStringwriteLazyByteString+haskey-btree-0.1.0.0-8qwGTL1JiDp13EeQLqMvXXData.BTree.Primitives.IdsPageIdTxId OverflowIdbaseGHC.BaseNothingghc-prim GHC.TypesTruegetmodify'fromFileStoreT lookupHandlegetsfromMemoryStoreT lookupFile lookupPage