<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="BatFingerTree.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="BatArray" rel="Chapter" href="BatArray.html"> <link title="BatAvlTree" rel="Chapter" href="BatAvlTree.html"> <link title="BatBase64" rel="Chapter" href="BatBase64.html"> <link title="BatBig_int" rel="Chapter" href="BatBig_int.html"> <link title="BatBigarray" rel="Chapter" href="BatBigarray.html"> <link title="BatBitSet" rel="Chapter" href="BatBitSet.html"> <link title="BatBool" rel="Chapter" href="BatBool.html"> <link title="BatBounded" rel="Chapter" href="BatBounded.html"> <link title="BatBuffer" rel="Chapter" href="BatBuffer.html"> <link title="BatCache" rel="Chapter" href="BatCache.html"> <link title="BatChar" rel="Chapter" href="BatChar.html"> <link title="BatCharParser" rel="Chapter" href="BatCharParser.html"> <link title="BatComplex" rel="Chapter" href="BatComplex.html"> <link title="BatConcurrent" rel="Chapter" href="BatConcurrent.html"> <link title="BatDeque" rel="Chapter" href="BatDeque.html"> <link title="BatDigest" rel="Chapter" href="BatDigest.html"> <link title="BatDllist" rel="Chapter" href="BatDllist.html"> <link title="BatDynArray" rel="Chapter" href="BatDynArray.html"> <link title="BatEnum" rel="Chapter" href="BatEnum.html"> <link title="BatFile" rel="Chapter" href="BatFile.html"> <link title="BatFingerTree" rel="Chapter" href="BatFingerTree.html"> <link title="BatFloat" rel="Chapter" href="BatFloat.html"> <link title="BatFormat" rel="Chapter" href="BatFormat.html"> <link title="BatGc" rel="Chapter" href="BatGc.html"> <link title="BatGenlex" rel="Chapter" href="BatGenlex.html"> <link title="BatGlobal" rel="Chapter" href="BatGlobal.html"> <link title="BatHashcons" rel="Chapter" href="BatHashcons.html"> <link title="BatHashtbl" rel="Chapter" href="BatHashtbl.html"> <link title="BatHeap" rel="Chapter" href="BatHeap.html"> <link title="BatIMap" rel="Chapter" href="BatIMap.html"> <link title="BatIO" rel="Chapter" href="BatIO.html"> <link title="BatISet" rel="Chapter" href="BatISet.html"> <link title="BatInnerIO" rel="Chapter" href="BatInnerIO.html"> <link title="BatInnerPervasives" rel="Chapter" href="BatInnerPervasives.html"> <link title="BatInnerWeaktbl" rel="Chapter" href="BatInnerWeaktbl.html"> <link title="BatInt" rel="Chapter" href="BatInt.html"> <link title="BatInt32" rel="Chapter" href="BatInt32.html"> <link title="BatInt64" rel="Chapter" href="BatInt64.html"> <link title="BatInterfaces" rel="Chapter" href="BatInterfaces.html"> <link title="BatLazyList" rel="Chapter" href="BatLazyList.html"> <link title="BatLexing" rel="Chapter" href="BatLexing.html"> <link title="BatList" rel="Chapter" href="BatList.html"> <link title="BatLog" rel="Chapter" href="BatLog.html"> <link title="BatLogger" rel="Chapter" href="BatLogger.html"> <link title="BatMap" rel="Chapter" href="BatMap.html"> <link title="BatMarshal" rel="Chapter" href="BatMarshal.html"> <link title="BatMultiMap" rel="Chapter" href="BatMultiMap.html"> <link title="BatMultiPMap" rel="Chapter" href="BatMultiPMap.html"> <link title="BatMutex" rel="Chapter" href="BatMutex.html"> <link title="BatNativeint" rel="Chapter" href="BatNativeint.html"> <link title="BatNum" rel="Chapter" href="BatNum.html"> <link title="BatNumber" rel="Chapter" href="BatNumber.html"> <link title="BatOo" rel="Chapter" href="BatOo.html"> <link title="BatOptParse" rel="Chapter" href="BatOptParse.html"> <link title="BatOption" rel="Chapter" href="BatOption.html"> <link title="BatOrd" rel="Chapter" href="BatOrd.html"> <link title="BatParserCo" rel="Chapter" href="BatParserCo.html"> <link title="BatPathGen" rel="Chapter" href="BatPathGen.html"> <link title="BatPervasives" rel="Chapter" href="BatPervasives.html"> <link title="BatPrintexc" rel="Chapter" href="BatPrintexc.html"> <link title="BatPrintf" rel="Chapter" href="BatPrintf.html"> <link title="BatQueue" rel="Chapter" href="BatQueue.html"> <link title="BatRMutex" rel="Chapter" href="BatRMutex.html"> <link title="BatRandom" rel="Chapter" href="BatRandom.html"> <link title="BatRef" rel="Chapter" href="BatRef.html"> <link title="BatRefList" rel="Chapter" href="BatRefList.html"> <link title="BatResult" rel="Chapter" href="BatResult.html"> <link title="BatReturn" rel="Chapter" href="BatReturn.html"> <link title="BatScanf" rel="Chapter" href="BatScanf.html"> <link title="BatSeq" rel="Chapter" href="BatSeq.html"> <link title="BatSet" rel="Chapter" href="BatSet.html"> <link title="BatSplay" rel="Chapter" href="BatSplay.html"> <link title="BatStack" rel="Chapter" href="BatStack.html"> <link title="BatStream" rel="Chapter" href="BatStream.html"> <link title="BatString" rel="Chapter" href="BatString.html"> <link title="BatSubstring" rel="Chapter" href="BatSubstring.html"> <link title="BatSys" rel="Chapter" href="BatSys.html"> <link title="BatText" rel="Chapter" href="BatText.html"> <link title="BatTuple" rel="Chapter" href="BatTuple.html"> <link title="BatUChar" rel="Chapter" href="BatUChar.html"> <link title="BatUTF8" rel="Chapter" href="BatUTF8.html"> <link title="BatUnit" rel="Chapter" href="BatUnit.html"> <link title="BatUnix" rel="Chapter" href="BatUnix.html"> <link title="BatUref" rel="Chapter" href="BatUref.html"> <link title="BatVect" rel="Chapter" href="BatVect.html"> <link title="Batteries" rel="Chapter" href="Batteries.html"> <link title="BatteriesConfig" rel="Chapter" href="BatteriesConfig.html"> <link title="BatteriesPrint" rel="Chapter" href="BatteriesPrint.html"> <link title="BatteriesThread" rel="Chapter" href="BatteriesThread.html"> <link title="Extlib" rel="Chapter" href="Extlib.html"><link title="Construction" rel="Section" href="#6_Construction"> <link title="Deconstruction" rel="Section" href="#6_Deconstruction"> <link title="Inspection" rel="Section" href="#6_Inspection"> <link title="Conversions" rel="Section" href="#6_Conversions"> <link title="Combining/reorganizing" rel="Section" href="#6_Combiningreorganizing"> <link title="Boilerplate code" rel="Section" href="#6_Boilerplatecode"> <link title="Conversions to other structures" rel="Subsection" href="#7_Conversionstootherstructures"> <link title="Conversions from other structures" rel="Subsection" href="#7_Conversionsfromotherstructures"> <title>Batteries user guide : BatFingerTree.S</title> </head> <body> <div class="navbar"> <a class="up" href="BatFingerTree.html" title="BatFingerTree">Up</a> </div> <h1>Module type <a href="type_BatFingerTree.S.html">BatFingerTree.S</a></h1> <pre><span class="keyword">module type</span> S = <code class="code"><span class="keyword">sig</span></code> <a href="BatFingerTree.S.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><hr width="100%"> <pre><span id="TYPEfg"><span class="keyword">type</span> <code class="type">('a, 'm)</code> fg</span> </pre> <div class="info "> The type of finger trees containing elements of type <code class="code"><span class="keywordsign">'</span>a</code> measured by <code class="code"><span class="keywordsign">'</span>m</code>.<br> </div> <pre><span id="TYPEwrap"><span class="keyword">type</span> <code class="type">('wrapped_type, 'a, 'm)</code> wrap</span> </pre> <div class="info "> A type meant to avoid duplication of signatures. <p> For the generic finger tree, this type will be <code class="code">monoid:<span class="keywordsign">'</span>m monoid <span class="keywordsign">-></span> measure:(<span class="keywordsign">'</span>a <span class="keywordsign">-></span> <span class="keywordsign">'</span>m) <span class="keywordsign">-></span> <span class="keywordsign">'</span>wrapped_type</code>. <p> Once the finger tree has been specialized, the resulting module should be reexported in such a way that the type is now simply <code class="code"><span class="keywordsign">'</span>wrapped_type</code>.<br> </div> <br> <h6 id="6_Construction">Construction</h6><br> <pre><span id="VALempty"><span class="keyword">val</span> empty</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a></code></pre><div class="info "> <code class="code">empty</code> is the sequence with no elements.<br> </div> <pre><span id="VALsingleton"><span class="keyword">val</span> singleton</span> : <code class="type">'a -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a></code></pre><div class="info "> <code class="code">singleton elt</code> build the sequence containing <code class="code">elt</code> as its sole element. <p> O(1).<br> </div> <pre><span id="VALcons"><span class="keyword">val</span> cons</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">cons t elt</code> adds <code class="code">elt</code> to the left of <code class="code">t</code>. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALsnoc"><span class="keyword">val</span> snoc</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">snoc t elt</code> adds <code class="code">elt</code> to the right of <code class="code">t</code>. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <br> <h6 id="6_Deconstruction">Deconstruction</h6><br> <pre><span id="VALfront"><span class="keyword">val</span> front</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> (('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> * 'a) option,<br> 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">front t</code> returns <code class="code"><span class="constructor">None</span></code> when <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> (tl, hd)</code> when <code class="code">hd</code> is the first element of the sequence and <code class="code">tl</code> is the rest of the sequence. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALfront_exn"><span class="keyword">val</span> front_exn</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> * 'a, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">front_exn t</code> returns <code class="code">(tl, hd)</code> when <code class="code">hd</code> is the first element of the sequence and <code class="code">tl</code> is the rest of the sequence.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALhead"><span class="keyword">val</span> head</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a option</code></pre><div class="info "> <code class="code">head t</code> returns <code class="code"><span class="constructor">None</span></code> if <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> hd</code> otherwise, where <code class="code">hd</code> is the first element of the sequence. <p> O(1).<br> </div> <pre><span id="VALhead_exn"><span class="keyword">val</span> head_exn</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a</code></pre><div class="info "> <code class="code">head_exn t</code> returns the first element of the sequence.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1).<br> </div> <pre><span id="VALlast"><span class="keyword">val</span> last</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a option</code></pre><div class="info "> <code class="code">last t</code> returns <code class="code"><span class="constructor">None</span></code> if <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> hd</code> otherwise, where <code class="code">hd</code> is the last element of the sequence. <p> O(1).<br> </div> <pre><span id="VALlast_exn"><span class="keyword">val</span> last_exn</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a</code></pre><div class="info "> <code class="code">last_exn t</code> returns the last element of the sequence.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1).<br> </div> <pre><span id="VALtail"><span class="keyword">val</span> tail</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> option, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">tail t</code> returns <code class="code"><span class="constructor">None</span></code> when <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> tl</code> where <code class="code">tl</code> is the sequence <code class="code">t</code> where the first element has been removed. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALtail_exn"><span class="keyword">val</span> tail_exn</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">tail_exn t</code> returns the sequence <code class="code">t</code> where the first element has been removed.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> option, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">init t</code> returns <code class="code"><span class="constructor">None</span></code> if <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> init</code> where <code class="code">init</code> is the sequence <code class="code">t</code> where the last element has been removed. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALinit_exn"><span class="keyword">val</span> init_exn</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">init_exn t</code> returns the sequence <code class="code">t</code> where the last element has been removed.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALrear"><span class="keyword">val</span> rear</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> (('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> * 'a) option,<br> 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">rear t</code> returns <code class="code"><span class="constructor">None</span></code> when <code class="code">t</code> is empty, or <code class="code"><span class="constructor">Some</span> (init, last)</code> where <code class="code">last</code> is the last element of the sequence and <code class="code">init</code> is the rest of the sequence. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <pre><span id="VALrear_exn"><span class="keyword">val</span> rear_exn</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> * 'a, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">rear t</code> returns <code class="code">(init, last)</code> when <code class="code">last</code> is the last element of the sequence and <code class="code">init</code> is the rest of the sequence.<br> <b>Raises</b> <code>Empty</code> if <code class="code">t</code> is empty. <p> O(1) amortized, O(log(n)) worst case.<br> </div> <br> <h6 id="6_Inspection">Inspection</h6><br> <pre><span id="VALsize"><span class="keyword">val</span> size</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> int</code></pre><div class="info "> <code class="code">size t</code> returns the number of elements in the sequence. If you want to know that a sequence is empty, it is much better to use <a href="BatFingerTree.S.html#VALis_empty"><code class="code"><span class="constructor">BatFingerTree</span>.<span class="constructor">S</span>.is_empty</code></a>. <p> O(n).<br> </div> <pre><span id="VALis_empty"><span class="keyword">val</span> is_empty</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> bool</code></pre><div class="info "> <code class="code">is_empty t</code> returns <code class="code"><span class="keyword">true</span></code> when the sequence has no elements. <p> O(1).<br> </div> <pre><span id="VALfold_left"><span class="keyword">val</span> fold_left</span> : <code class="type">('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'acc</code></pre><div class="info "> <code class="code">fold_left</code> is equivalent to <code class="code"><span class="constructor">List</span>.fold_left</code>. <p> O(n).<br> </div> <pre><span id="VALfold_right"><span class="keyword">val</span> fold_right</span> : <code class="type">('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'acc</code></pre><div class="info "> <code class="code">fold_right</code> is equivalent to <code class="code"><span class="constructor">List</span>.fold_right</code>. <p> O(n).<br> </div> <pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">('a -> unit) -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> unit</code></pre><div class="info "> <code class="code">iter</code> is equivalent to <code class="code"><span class="constructor">List</span>.iter</code>. <p> O(n).<br> </div> <pre><span id="VALiter_right"><span class="keyword">val</span> iter_right</span> : <code class="type">('a -> unit) -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> unit</code></pre><div class="info "> <code class="code">iter_right</code> is equivalent to <code class="code"><span class="constructor">List</span>.iter o <span class="constructor">List</span>.rev</code>. <p> O(n).<br> </div> <pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type">('a -> 'a -> int) -><br> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> int</code></pre><div class="info "> <code class="code">compare cmp t1 t2</code> compares the two sequences lexicographically. <p> O(n).<br> </div> <pre><span id="VALequal"><span class="keyword">val</span> equal</span> : <code class="type">('a -> 'a -> bool) -><br> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> bool</code></pre><div class="info "> <code class="code">equal eq t1 t2</code> returns <code class="code"><span class="keyword">true</span></code> when the two sequences contain the the same elements. <p> O(n).<br> </div> <br> <h6 id="6_Conversions">Conversions</h6><br> <br> <div class="h7" id="7_Conversionstootherstructures">Conversions to other structures</div><br> <pre><span id="VALenum"><span class="keyword">val</span> enum</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a <a href="BatEnum.html#TYPEt">BatEnum.t</a></code></pre><div class="info "> <code class="code">enum t</code> builds an enumeration of the elements of <code class="code">t</code> going from left to right. <p> O(1). <p> Forcing the whole enumeration takes O(n).<br> </div> <pre><span id="VALbackwards"><span class="keyword">val</span> backwards</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a <a href="BatEnum.html#TYPEt">BatEnum.t</a></code></pre><div class="info "> <code class="code">backwards t</code> builds an enumeration of the elements of <code class="code">t</code> going from right to left. Same complexity as <a href="BatFingerTree.S.html#VALenum"><code class="code"><span class="constructor">BatFingerTree</span>.<span class="constructor">S</span>.enum</code></a>.<br> </div> <pre><span id="VALto_list"><span class="keyword">val</span> to_list</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a list</code></pre><div class="info "> <code class="code">to_list t</code> is equivalent to <code class="code"><span class="constructor">BatList</span>.of_enum (enum t)</code>. <p> O(n).<br> </div> <pre><span id="VALto_list_backwards"><span class="keyword">val</span> to_list_backwards</span> : <code class="type">('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> 'a list</code></pre><div class="info "> <code class="code">to_list_backwards t</code> is equivalent to <code class="code"><span class="constructor">BatList</span>.of_enum (backwards t)</code>. <p> O(n).<br> </div> <br> <div class="h7" id="7_Conversionsfromotherstructures">Conversions from other structures</div><br> <pre><span id="VALof_enum"><span class="keyword">val</span> of_enum</span> : <code class="type">('a <a href="BatEnum.html#TYPEt">BatEnum.t</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm) <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">of_enum e</code> build the sequence containing the elements of <code class="code">e</code> in the same order. <p> Its complexity is the complexity of forcing the enumeration.<br> </div> <pre><span id="VALof_backwards"><span class="keyword">val</span> of_backwards</span> : <code class="type">('a <a href="BatEnum.html#TYPEt">BatEnum.t</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm) <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">of_backward e</code> is equivalent to <code class="code">reverse (of_enum e)</code>. <p> O(n).<br> </div> <pre><span id="VALof_list"><span class="keyword">val</span> of_list</span> : <code class="type">('a list -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm) <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">of_list l</code> is equivalent to <code class="code">of_enum (<span class="constructor">BatList</span>.enum l)</code>. <p> O(n).<br> </div> <pre><span id="VALof_list_backwards"><span class="keyword">val</span> of_list_backwards</span> : <code class="type">('a list -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm) <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">of_list_backwards l</code> is equivalent to <code class="code">of_enum_backwards (<span class="constructor">BatList</span>.enum l)</code>. <p> O(n).<br> </div> <br> <h6 id="6_Combiningreorganizing">Combining/reorganizing</h6><br> <pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">(('a -> 'b) -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('b, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>,<br> 'b, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">map</code> is equivalent to <code class="code"><span class="constructor">List</span>.map</code>. <p> O(n).<br> </div> <pre><span id="VALmap_right"><span class="keyword">val</span> map_right</span> : <code class="type">(('a -> 'b) -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('b, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>,<br> 'b, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">map_right</code> is equivalent to <code class="code"><span class="constructor">List</span>.rev o <span class="constructor">List</span>.map o <span class="constructor">List</span>.rev</code>. <p> O(n).<br> </div> <pre><span id="VALappend"><span class="keyword">val</span> append</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -><br> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">append</code> is equivalent to <code class="code"><span class="constructor">List</span>.append</code>. <p> O(log(min(n,m))).<br> </div> <pre><span id="VALreverse"><span class="keyword">val</span> reverse</span> : <code class="type">(('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a> -> ('a, 'm) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'a, 'm)<br> <a href="BatFingerTree.S.html#TYPEwrap">wrap</a></code></pre><div class="info "> <code class="code">reverse t</code> is equivalent to <code class="code">of_list (<span class="constructor">List</span>.rev (to_list t))</code>. <p> O(n).<br> </div> <br> <h6 id="6_Boilerplatecode">Boilerplate code</h6><br> <pre><span id="VALprint"><span class="keyword">val</span> print</span> : <code class="type">?first:string -><br> ?last:string -><br> ?sep:string -><br> ('a, 'b) <a href="BatIO.html#TYPEprinter">BatIO.printer</a> -> (('a, 'c) <a href="BatFingerTree.S.html#TYPEfg">fg</a>, 'b) <a href="BatIO.html#TYPEprinter">BatIO.printer</a></code></pre></body></html>