!MEE      !"#$%&'()*+,-./ 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 XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe%,-CFNQSTUV]eiSafe%,-CFNQSTUV]ei apart?Type that can tell you about aggregate state of your structure.apartSegment of values in memoryapart Segment of values somewhere else(C) 2018 Murat Kasimov BSD-style (see the file LICENSE)%Murat Kasimov <iokasimov.m@gmail.com> experimental non-portableSafe%,-CFNQSTUV]eiapart"Structure with scattered segments.Safe%,-CFNQSTUV]eiSafe%,-CFNQSTUV]ei!apartInfinite sequence.Safe%,-CFNQSTUV]ei  Safe%,-CFNQSTUV]ei!"#$%&!"#$%&Safe%,-CFNQSTUV]ei'()*,-+.'()*,-+. Safe%,-CFNQSTUV]ei/01233210/ Safe%,-CFNQSTUV]ei5apart No children6apart Left child7apart Right child8apartBoth:apartGet x from  Branches x y or from Less x.;apartGet y from  Branches x y or from  Greater y.>apart"The way to the most remote branch.?apartBalance factor for root node. 485679:;<=>? 948567:;<=>? Safe%,-CFNQSTUV]eiWIapart#Simple left (AVL), left zig (Splay)Japart%Simple right (AVL), right zig (Splay)Kapart)Double right (AVL), right zig-zag (Splay)Lapart'Double left (AVL), left zig-zag (Splay)MapartLeft zig-zig (Splay)NapartRight zig-zig (Splay)HJIKLMNOHJIKLMNO Safe%,-CFNQSTUV]eiPapartSplay tree after each insert.Qapart3If needed element not in the root - it isn't found.PQQP Safe%,-CFNQSTUV]ei RSTUVRSTUVSafe%,-CFNQSTUV]ei"CXapart(Trying rebalance tree after each insert.XXSafe%,-CFNQSTUV]ei#oYapartOr non-empty list.YZ[\]Y[Z\]Safe%,-CFNQSTUV]ei(apartPrefix tree haven't nodesapart#Key and current key of root matchedapart Keys matched and this is the endcapartYou can insert value with path + 1 symbol of existing path in tree.dapartUnlike insertN, you can specify longest path, but a gap will be filled Monoid's empty values^_`abcd`^_abcdSafe%,-CFNQSTUV]ei+mapartDirected acyclic graph.papart#Remove vertex and all of its edges.ijklmnopmijklnopSafe%,-CFNQSTUV]ei1Nuapart'Put in-memory values to somewhere else.vapart&Pull back segment of values to memory.wapartLDo nothing with in-memory part, pull back all values of structure to memory.xapartMKeep only a certain number of elements in memory, do something with the rest.yapartHTraverse over scattered structure, including with all restored segments.uvwxyzvuwxyzSafe%,-CFNQSTUV]ei?{apartOur blockchain type is distributed - we really don't want to keep all chain in memory, instead, we'll store balance table of all accounts in some database.|apart=Block is just a bunch of transactions, no pointers/keys here.}apart2Simplified transaction type, no certificates/keys.apartjLet's suppose that genesis is a regular transaction, but proceeded from magic account 0 to real accounts. } 0 1000 1  apart)First real block, 1 sends 50 tokens to 4. } 1 50 4  apartWe're facing with increasing chain in memory, so, let's calculate UTXO for each account and put this information somewhere else.  $    ...apartVerifying block is just a calculation UTXO for each account that trying to send money, so, we already have balance table and current block, the task becomes simple - just match transactions and balances. {|}~ }~|{Safe%,-CFNQSTUV]eiEsapartIn this usage example we'll try to implement LRU cache. This policy discards the least recently used items first, so we need to add priority for the most recently used elements. Very resembles behavoir of Splay trees, actually.apart@Insert sortable value to cache, aftear that, value moved to root !"##$%&'()**+,-./0123456789:;67<89= > ? @ A B C D E F C G H I 2 J K L M N O P Q R S T U V W X Y Z [ \ J ] ^ _ ` a b cJd2Jefghi2jJklmnopqrstuvwxyz{|}~"apart-0.1.3-4cl3yhXGlwoCGOkA1F9QFUData.Apart.Machinery.MooreData.Apart.Shape Data.Apart Data.Apart.Structures.DictionaryData.Apart.Structures.StreamData.Apart.Structures.Tree.RoseData.Apart.Structures.Tree.T23Data.Apart.Structures.Tree.T234Data.Apart.Transformations!Data.Apart.Structures.Tree.Binary*Data.Apart.Structures.Tree.Binary.Rotation'Data.Apart.Structures.Tree.Binary.Splay*Data.Apart.Structures.Tree.Binary.Redblack%Data.Apart.Structures.Tree.Binary.AVLData.Apart.Structures.Stack!Data.Apart.Structures.Tree.PrefixData.Apart.Structures.GraphData.Apart.CombinatorsData.Apart.Usage.BlockchainData.Apart.Usage.LRUMooredumbShapeReady Converted$fBitraversableShape$fBifoldableShape$fBifunctorShape$fTraversableShape$fFoldableShape $fAltShape $fApplyShape$fFunctorShape $fShowShapeApartpart$fBitraversableApart$fBifoldableApart$fBifunctorApart $fApplyApart$fFunctorApart Association Dictionary$fTraversableAssociation$fFoldableAssociation$fFunctorAssociationStreamsameRose singleton constructT23N23L2L3B2B3T234N234L4B4 Scattered SegmentedInjectedEmbeddedAttachedBranchesEndLessGreaterBinarylsgtinsertheightfactor$fTraversableBranches$fFoldableBranches$fFunctorBranches$fBindBranches $fAltBranches$fApplyBranches$fSemigroupBranches$fShowBranchesRotateLRLRRLLLRRrttsearchRedblackColorRedBlackpaint $fShowColorStackfoldawayfinalLabeledHopPrefixseekcrumbs$fTraversableLabeled$fFoldableLabeled$fFunctorLabeled $fShowLabeledEdgesEmptyConnectOverlayGraphisolatedstarremove$fTraversableEdges$fFoldableEdges$fFunctorEdges $fShowEdges MaterializerRestorerrecoverlimit throughoutinmemory BlockchainBlock Transactionfromamounttogenesisblock mainchainverifyLRUcachedeadendprogressexactlyfree-5.1-LZmAaEftK9g1faNwdSPWOUControl.Comonad.Cofree:<baseGHC.BaseNothing