doc/classes/Prelude/List.html in prelude-0.0.2 vs doc/classes/Prelude/List.html in prelude-0.0.3

- old
+ new

@@ -3,11 +3,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>Class: Prelude::List</title> + <title>Module: Prelude::List</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ @@ -47,11 +47,11 @@ <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> - <td><strong>Class</strong></td> + <td><strong>Module</strong></td> <td class="class-name-in-header">Prelude::List</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> @@ -60,16 +60,10 @@ </a> <br /> </td> </tr> - <tr class="top-aligned-row"> - <td><strong>Parent:</strong></td> - <td> - Array - </td> - </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> @@ -78,161 +72,124 @@ <div id="contextContent"> <div id="description"> <p> -$Id: list.rb 7 2006-09-06 17:03:26Z prelude $ +$Id: list.rb 17 2006-09-17 18:03:15Z prelude $ </p> <p> This eventually needs to be implemented with lazy lists, see <a href="http://lazylist.rubyforge.org">lazylist.rubyforge.org</a> for details </p> <p> I used the signatures of Haskell&#8217;s List.hs file in order not to forget to implement the functions defined there and to remind of what was intended. </p> -<p> -The following methods are implemented by Array with the same semantics: -</p> -<ul> -<li>last &#8212; :: [a] -&gt; a -</li> -<li>length &#8212; :: [a] -&gt; Int - -</li> -<li>map &#8212; :: (a -&gt; b) -&gt; [a] -&gt; [b] - -</li> -<li>reverse &#8212; :: [a] -&gt; [a] - -</li> -<li>transpose &#8212; :: [[a]] -&gt; [[a]] - -</li> -<li>find &#8212; :: (a -&gt; Bool) -&gt; [a] -&gt; Maybe a - -</li> -<li>partition &#8212; :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a]) - -</li> -<li>zip &#8212; :: [a] -&gt; [b] -&gt; [(a,b)] - -</li> -<li>sort &#8212; :: (Ord a) =&gt; [a] -&gt; [a] - -</li> -</ul> -<p> -I do not know how to implement these in Ruby: -</p> -<ul> -<li>(!!) &#8212; :: [a] -&gt; Int -&gt; a - -</li> -<li>(\) &#8212; :: (Eq a) =&gt; [a] -&gt; [a] -&gt; [a] - -</li> -</ul> - </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000012">+</a>&nbsp;&nbsp; - <a href="#M000031">all</a>&nbsp;&nbsp; - <a href="#M000028">and</a>&nbsp;&nbsp; - <a href="#M000030">any</a>&nbsp;&nbsp; - <a href="#M000058">break</a>&nbsp;&nbsp; - <a href="#M000025">concat</a>&nbsp;&nbsp; - <a href="#M000027">concatMap</a>&nbsp;&nbsp; - <a href="#M000026">concat_map</a>&nbsp;&nbsp; - <a href="#M000047">cycle</a>&nbsp;&nbsp; - <a href="#M000095">delete</a>&nbsp;&nbsp; - <a href="#M000050">drop</a>&nbsp;&nbsp; - <a href="#M000056">dropWhile</a>&nbsp;&nbsp; - <a href="#M000055">drop_while</a>&nbsp;&nbsp; - <a href="#M000066">elem</a>&nbsp;&nbsp; - <a href="#M000072">elemIndex</a>&nbsp;&nbsp; - <a href="#M000074">elemIndices</a>&nbsp;&nbsp; - <a href="#M000071">elem_index</a>&nbsp;&nbsp; - <a href="#M000073">elem_indices</a>&nbsp;&nbsp; - <a href="#M000018">f_foldl</a>&nbsp;&nbsp; - <a href="#M000070">filter</a>&nbsp;&nbsp; - <a href="#M000076">findIndex</a>&nbsp;&nbsp; - <a href="#M000078">findIndices</a>&nbsp;&nbsp; - <a href="#M000075">find_index</a>&nbsp;&nbsp; - <a href="#M000077">find_indices</a>&nbsp;&nbsp; - <a href="#M000019">foldl</a>&nbsp;&nbsp; - <a href="#M000021">foldl1</a>&nbsp;&nbsp; - <a href="#M000022">foldl1_</a>&nbsp;&nbsp; - <a href="#M000020">foldl_</a>&nbsp;&nbsp; - <a href="#M000023">foldr</a>&nbsp;&nbsp; - <a href="#M000024">foldr1</a>&nbsp;&nbsp; - <a href="#M000059">group</a>&nbsp;&nbsp; - <a href="#M000013">head</a>&nbsp;&nbsp; - <a href="#M000015">init</a>&nbsp;&nbsp; - <a href="#M000060">inits</a>&nbsp;&nbsp; - <a href="#M000098">insert</a>&nbsp;&nbsp; - <a href="#M000097">intersect</a>&nbsp;&nbsp; - <a href="#M000017">intersperse</a>&nbsp;&nbsp; - <a href="#M000063">isPrefixOf</a>&nbsp;&nbsp; - <a href="#M000065">isSuffixOf</a>&nbsp;&nbsp; - <a href="#M000062">is_prefix_of</a>&nbsp;&nbsp; - <a href="#M000064">is_suffix_of</a>&nbsp;&nbsp; - <a href="#M000044">iterate</a>&nbsp;&nbsp; - <a href="#M000090">lines</a>&nbsp;&nbsp; - <a href="#M000069">lookup</a>&nbsp;&nbsp; - <a href="#M000041">mapAccumL</a>&nbsp;&nbsp; - <a href="#M000043">mapAccumR</a>&nbsp;&nbsp; - <a href="#M000040">map_accum_l</a>&nbsp;&nbsp; - <a href="#M000042">map_accum_r</a>&nbsp;&nbsp; - <a href="#M000034">maximum</a>&nbsp;&nbsp; - <a href="#M000035">minimum</a>&nbsp;&nbsp; - <a href="#M000068">notElem</a>&nbsp;&nbsp; - <a href="#M000067">not_elem</a>&nbsp;&nbsp; - <a href="#M000094">nub</a>&nbsp;&nbsp; - <a href="#M000016">null</a>&nbsp;&nbsp; - <a href="#M000029">or</a>&nbsp;&nbsp; - <a href="#M000033">product</a>&nbsp;&nbsp; - <a href="#M000045">repeat</a>&nbsp;&nbsp; - <a href="#M000046">replicate</a>&nbsp;&nbsp; - <a href="#M000036">scanl</a>&nbsp;&nbsp; - <a href="#M000037">scanl1</a>&nbsp;&nbsp; - <a href="#M000038">scanr</a>&nbsp;&nbsp; - <a href="#M000039">scanr1</a>&nbsp;&nbsp; - <a href="#M000057">span</a>&nbsp;&nbsp; - <a href="#M000052">splitAt</a>&nbsp;&nbsp; - <a href="#M000051">split_at</a>&nbsp;&nbsp; - <a href="#M000032">sum</a>&nbsp;&nbsp; - <a href="#M000014">tail</a>&nbsp;&nbsp; - <a href="#M000061">tails</a>&nbsp;&nbsp; - <a href="#M000049">take</a>&nbsp;&nbsp; - <a href="#M000054">takeWhile</a>&nbsp;&nbsp; - <a href="#M000053">take_while</a>&nbsp;&nbsp; - <a href="#M000048">unfoldr</a>&nbsp;&nbsp; - <a href="#M000096">union</a>&nbsp;&nbsp; - <a href="#M000092">unlines</a>&nbsp;&nbsp; - <a href="#M000093">unwords</a>&nbsp;&nbsp; - <a href="#M000087">unzip</a>&nbsp;&nbsp; - <a href="#M000088">unzip3</a>&nbsp;&nbsp; - <a href="#M000089">unzip4</a>&nbsp;&nbsp; - <a href="#M000091">words</a>&nbsp;&nbsp; - <a href="#M000079">zip3</a>&nbsp;&nbsp; - <a href="#M000080">zip4</a>&nbsp;&nbsp; - <a href="#M000082">zipWith</a>&nbsp;&nbsp; - <a href="#M000084">zipWith3</a>&nbsp;&nbsp; - <a href="#M000086">zipWith4</a>&nbsp;&nbsp; - <a href="#M000081">zip_with</a>&nbsp;&nbsp; - <a href="#M000083">zip_with3</a>&nbsp;&nbsp; - <a href="#M000085">zip_with4</a>&nbsp;&nbsp; + <a href="#M000038">all</a>&nbsp;&nbsp; + <a href="#M000035">and_</a>&nbsp;&nbsp; + <a href="#M000037">any</a>&nbsp;&nbsp; + <a href="#M000064">break_</a>&nbsp;&nbsp; + <a href="#M000032">concat</a>&nbsp;&nbsp; + <a href="#M000034">concatMap</a>&nbsp;&nbsp; + <a href="#M000033">concat_map</a>&nbsp;&nbsp; + <a href="#M000054">cycle</a>&nbsp;&nbsp; + <a href="#M000104">delete</a>&nbsp;&nbsp; + <a href="#M000057">drop</a>&nbsp;&nbsp; + <a href="#M000062">dropWhile</a>&nbsp;&nbsp; + <a href="#M000061">drop_while</a>&nbsp;&nbsp; + <a href="#M000072">elem</a>&nbsp;&nbsp; + <a href="#M000080">elemIndex</a>&nbsp;&nbsp; + <a href="#M000082">elemIndices</a>&nbsp;&nbsp; + <a href="#M000079">elem_index</a>&nbsp;&nbsp; + <a href="#M000081">elem_indices</a>&nbsp;&nbsp; + <a href="#M000077">filter</a>&nbsp;&nbsp; + <a href="#M000076">find</a>&nbsp;&nbsp; + <a href="#M000084">findIndex</a>&nbsp;&nbsp; + <a href="#M000086">findIndices</a>&nbsp;&nbsp; + <a href="#M000083">find_index</a>&nbsp;&nbsp; + <a href="#M000085">find_indices</a>&nbsp;&nbsp; + <a href="#M000026">foldl</a>&nbsp;&nbsp; + <a href="#M000028">foldl1</a>&nbsp;&nbsp; + <a href="#M000029">foldl1_</a>&nbsp;&nbsp; + <a href="#M000027">foldl_</a>&nbsp;&nbsp; + <a href="#M000030">foldr</a>&nbsp;&nbsp; + <a href="#M000031">foldr1</a>&nbsp;&nbsp; + <a href="#M000065">group</a>&nbsp;&nbsp; + <a href="#M000016">head</a>&nbsp;&nbsp; + <a href="#M000019">init</a>&nbsp;&nbsp; + <a href="#M000066">inits</a>&nbsp;&nbsp; + <a href="#M000108">insert</a>&nbsp;&nbsp; + <a href="#M000106">intersect</a>&nbsp;&nbsp; + <a href="#M000024">intersperse</a>&nbsp;&nbsp; + <a href="#M000069">isPrefixOf</a>&nbsp;&nbsp; + <a href="#M000071">isSuffixOf</a>&nbsp;&nbsp; + <a href="#M000068">is_prefix_of</a>&nbsp;&nbsp; + <a href="#M000070">is_suffix_of</a>&nbsp;&nbsp; + <a href="#M000051">iterate</a>&nbsp;&nbsp; + <a href="#M000018">last</a>&nbsp;&nbsp; + <a href="#M000021">length</a>&nbsp;&nbsp; + <a href="#M000099">lines</a>&nbsp;&nbsp; + <a href="#M000075">lookup</a>&nbsp;&nbsp; + <a href="#M000022">map</a>&nbsp;&nbsp; + <a href="#M000048">mapAccumL</a>&nbsp;&nbsp; + <a href="#M000050">mapAccumR</a>&nbsp;&nbsp; + <a href="#M000047">map_accum_l</a>&nbsp;&nbsp; + <a href="#M000049">map_accum_r</a>&nbsp;&nbsp; + <a href="#M000041">maximum</a>&nbsp;&nbsp; + <a href="#M000042">minimum</a>&nbsp;&nbsp; + <a href="#M000074">notElem</a>&nbsp;&nbsp; + <a href="#M000073">not_elem</a>&nbsp;&nbsp; + <a href="#M000103">nub</a>&nbsp;&nbsp; + <a href="#M000020">null</a>&nbsp;&nbsp; + <a href="#M000036">or_</a>&nbsp;&nbsp; + <a href="#M000078">partition</a>&nbsp;&nbsp; + <a href="#M000040">product</a>&nbsp;&nbsp; + <a href="#M000052">repeat</a>&nbsp;&nbsp; + <a href="#M000053">replicate</a>&nbsp;&nbsp; + <a href="#M000023">reverse</a>&nbsp;&nbsp; + <a href="#M000043">scanl</a>&nbsp;&nbsp; + <a href="#M000044">scanl1</a>&nbsp;&nbsp; + <a href="#M000045">scanr</a>&nbsp;&nbsp; + <a href="#M000046">scanr1</a>&nbsp;&nbsp; + <a href="#M000107">sort</a>&nbsp;&nbsp; + <a href="#M000063">span</a>&nbsp;&nbsp; + <a href="#M000058">split_at</a>&nbsp;&nbsp; + <a href="#M000039">sum</a>&nbsp;&nbsp; + <a href="#M000017">tail</a>&nbsp;&nbsp; + <a href="#M000067">tails</a>&nbsp;&nbsp; + <a href="#M000056">take</a>&nbsp;&nbsp; + <a href="#M000060">takeWhile</a>&nbsp;&nbsp; + <a href="#M000059">take_while</a>&nbsp;&nbsp; + <a href="#M000025">transpose</a>&nbsp;&nbsp; + <a href="#M000055">unfoldr</a>&nbsp;&nbsp; + <a href="#M000105">union</a>&nbsp;&nbsp; + <a href="#M000101">unlines</a>&nbsp;&nbsp; + <a href="#M000102">unwords</a>&nbsp;&nbsp; + <a href="#M000096">unzip</a>&nbsp;&nbsp; + <a href="#M000097">unzip3</a>&nbsp;&nbsp; + <a href="#M000098">unzip4</a>&nbsp;&nbsp; + <a href="#M000100">words</a>&nbsp;&nbsp; + <a href="#M000087">zip</a>&nbsp;&nbsp; + <a href="#M000088">zip3</a>&nbsp;&nbsp; + <a href="#M000089">zip4</a>&nbsp;&nbsp; + <a href="#M000091">zipWith</a>&nbsp;&nbsp; + <a href="#M000093">zipWith3</a>&nbsp;&nbsp; + <a href="#M000095">zipWith4</a>&nbsp;&nbsp; + <a href="#M000090">zip_with</a>&nbsp;&nbsp; + <a href="#M000092">zip_with3</a>&nbsp;&nbsp; + <a href="#M000094">zip_with4</a>&nbsp;&nbsp; </div> </div> </div> @@ -241,2299 +198,2485 @@ <div id="section"> - <div id="aliases-list"> - <h3 class="section-bar">External Aliases</h3> - <div class="name-list"> - <table summary="aliases"> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">+</td> - <td>-&gt;</td> - <td class="context-item-value">array_plus</td> - </tr> - <tr class="top-aligned-row context-row"> - <td>&nbsp;</td> - <td colspan="2" class="context-item-desc"> -Array compatibility functions -</td> - </tr> - </table> - </div> - </div> - - <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000012" class="method-detail"> - <a name="M000012"></a> + <div id="method-M000038" class="method-detail"> + <a name="M000038"></a> <div class="method-heading"> - <a href="#M000012" class="method-signature"> - <span class="method-name">+</span><span class="method-args">(o)</span> + <a href="#M000038" class="method-signature"> + <span class="method-name">all</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000012-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000012-source"> -<pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 55</span> -55: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">o</span>) -56: <span class="ruby-constant">List</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">array_plus</span>(<span class="ruby-identifier">o</span>)) -57: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000031" class="method-detail"> - <a name="M000031"></a> - - <div class="method-heading"> - <a href="#M000031" class="method-signature"> - <span class="method-name">all</span><span class="method-args">(&amp;block)</span> - </a> - </div> - - <div class="method-description"> <table> <tr><td valign="top">all &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000031-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000031-source"> + onclick="toggleCode('M000038-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000038-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 159</span> -159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -160: <span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">e</span>)} -161: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -162: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 180</span> +180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +181: <span class="ruby-identifier">and_</span>(<span class="ruby-operator">~</span><span class="ruby-identifier">map</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>)) +182: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000028" class="method-detail"> - <a name="M000028"></a> + <div id="method-M000035" class="method-detail"> + <a name="M000035"></a> <div class="method-heading"> - <a href="#M000028" class="method-signature"> - <span class="method-name">and</span><span class="method-args">()</span> + <a href="#M000035" class="method-signature"> + <span class="method-name">and_</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">and &#8212; :</td><td>[Bool] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000028-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000028-source"> + onclick="toggleCode('M000035-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000035-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 143</span> -143: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">and</span> -144: <span class="ruby-identifier">foldr</span>(<span class="ruby-keyword kw">true</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">y</span>} -145: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 165</span> +165: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">and_</span>(<span class="ruby-identifier">list</span>) +166: <span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">lambda</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">y</span>}, <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">list</span>) +167: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000030" class="method-detail"> - <a name="M000030"></a> + <div id="method-M000037" class="method-detail"> + <a name="M000037"></a> <div class="method-heading"> - <a href="#M000030" class="method-signature"> - <span class="method-name">any</span><span class="method-args">(&amp;block)</span> + <a href="#M000037" class="method-signature"> + <span class="method-name">any</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">any &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000030-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000030-source"> + onclick="toggleCode('M000037-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000037-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 153</span> -153: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">any</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -154: <span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">e</span>)} -155: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -156: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 175</span> +175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">any</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +176: <span class="ruby-identifier">or_</span>(<span class="ruby-operator">~</span><span class="ruby-identifier">map</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>)) +177: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000058" class="method-detail"> - <a name="M000058"></a> + <div id="method-M000064" class="method-detail"> + <a name="M000064"></a> <div class="method-heading"> - <a href="#M000058" class="method-signature"> - <span class="method-name">break</span><span class="method-args">()</span> + <a href="#M000064" class="method-signature"> + <span class="method-name">break_</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">break &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a]) </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000058-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000058-source"> + onclick="toggleCode('M000064-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000064-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 315</span> -315: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">break</span> -316: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'break' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -317: <span class="ruby-keyword kw">return</span> [] -318: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 333</span> +333: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">break_</span>(<span class="ruby-identifier">list</span>) +334: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'break' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +335: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +336: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000025" class="method-detail"> - <a name="M000025"></a> + <div id="method-M000032" class="method-detail"> + <a name="M000032"></a> <div class="method-heading"> - <a href="#M000025" class="method-signature"> - <span class="method-name">concat</span><span class="method-args">()</span> + <a href="#M000032" class="method-signature"> + <span class="method-name">concat</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> - <p> -Implemented by Array but semantics is different -</p> -<table> + <table> <tr><td valign="top">concat &#8212; :</td><td>[[a]] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000025-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000025-source"> + onclick="toggleCode('M000032-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000032-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 131</span> -131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat</span> -132: <span class="ruby-identifier">flatten</span> -133: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 153</span> +153: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">list</span>) +154: <span class="ruby-identifier">foldr</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">:+</span>, [], <span class="ruby-identifier">list</span>) +155: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000027" class="method-detail"> - <a name="M000027"></a> + <div id="method-M000034" class="method-detail"> + <a name="M000034"></a> <div class="method-heading"> - <span class="method-name">concatMap</span><span class="method-args">()</span> + <span class="method-name">concatMap</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000026">concat_map</a> +Alias for <a href="List.html#M000033">concat_map</a> </p> </div> </div> - <div id="method-M000026" class="method-detail"> - <a name="M000026"></a> + <div id="method-M000033" class="method-detail"> + <a name="M000033"></a> <div class="method-heading"> - <a href="#M000026" class="method-signature"> - <span class="method-name">concat_map</span><span class="method-args">()</span> + <a href="#M000033" class="method-signature"> + <span class="method-name">concat_map</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">concatMap &#8212; :</td><td>(a -&gt; [b]) -&gt; [a] -&gt; [b] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000026-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000026-source"> + onclick="toggleCode('M000033-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000033-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 136</span> -136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat_map</span> -137: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'concatMap' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -138: <span class="ruby-keyword kw">return</span> [] -139: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 158</span> +158: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat_map</span>(<span class="ruby-identifier">list</span>) +159: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'concatMap' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +160: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +161: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000047" class="method-detail"> - <a name="M000047"></a> + <div id="method-M000054" class="method-detail"> + <a name="M000054"></a> <div class="method-heading"> - <a href="#M000047" class="method-signature"> - <span class="method-name">cycle</span><span class="method-args">()</span> + <a href="#M000054" class="method-signature"> + <span class="method-name">cycle</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">cycle &#8212; :</td><td>[a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000047-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000047-source"> + onclick="toggleCode('M000054-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000054-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 252</span> -252: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle</span> -253: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'cycle' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -254: <span class="ruby-keyword kw">return</span> [] -255: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 275</span> +275: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle</span>(<span class="ruby-identifier">list</span>) +276: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'cycle' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +277: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +278: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000095" class="method-detail"> - <a name="M000095"></a> + <div id="method-M000104" class="method-detail"> + <a name="M000104"></a> <div class="method-heading"> - <a href="#M000095" class="method-signature"> - <span class="method-name">delete</span><span class="method-args">(o)</span> + <a href="#M000104" class="method-signature"> + <span class="method-name">delete</span><span class="method-args">(o, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">delete &#8212; :</td><td>(Eq a) =&gt; a -&gt; [a] -&gt; [a] </td></tr> </table> -<p> -Implemented by Array but semantics is different -</p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000095-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000095-source"> + onclick="toggleCode('M000104-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000104-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 516</span> -516: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">o</span>) -517: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'delete' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -518: <span class="ruby-keyword kw">return</span> [] -519: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 555</span> +555: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">o</span>, <span class="ruby-identifier">list</span>) +556: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'delete' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +557: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +558: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000050" class="method-detail"> - <a name="M000050"></a> + <div id="method-M000057" class="method-detail"> + <a name="M000057"></a> <div class="method-heading"> - <a href="#M000050" class="method-signature"> - <span class="method-name">drop</span><span class="method-args">(n)</span> + <a href="#M000057" class="method-signature"> + <span class="method-name">drop</span><span class="method-args">(n, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">drop &#8212; :</td><td>Int -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000050-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000050-source"> + onclick="toggleCode('M000057-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000057-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 277</span> -277: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop</span>(<span class="ruby-identifier">n</span>) -278: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">n</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] -279: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 298</span> +298: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">list</span>) +299: <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>[<span class="ruby-identifier">n</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] } +300: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000056" class="method-detail"> - <a name="M000056"></a> + <div id="method-M000062" class="method-detail"> + <a name="M000062"></a> <div class="method-heading"> - <span class="method-name">dropWhile</span><span class="method-args">()</span> + <span class="method-name">dropWhile</span><span class="method-args">(p, list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000055">drop_while</a> +Alias for <a href="List.html#M000061">drop_while</a> </p> </div> </div> - <div id="method-M000055" class="method-detail"> - <a name="M000055"></a> + <div id="method-M000061" class="method-detail"> + <a name="M000061"></a> <div class="method-heading"> - <a href="#M000055" class="method-signature"> - <span class="method-name">drop_while</span><span class="method-args">() {|e| ...}</span> + <a href="#M000061" class="method-signature"> + <span class="method-name">drop_while</span><span class="method-args">(p, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">dropWhile &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000055-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000055-source"> + onclick="toggleCode('M000061-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000061-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 299</span> -299: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_while</span> -300: <span class="ruby-identifier">r</span> = [] -301: <span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> -302: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">e</span>) -303: <span class="ruby-identifier">r</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">e</span> -304: } -305: <span class="ruby-identifier">r</span> -306: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 318</span> +318: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_while</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>) +319: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +320: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { [] } +321: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">p</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)] <span class="ruby-operator">?</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">~</span><span class="ruby-identifier">drop_while</span>(<span class="ruby-identifier">p</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) } <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span> } +322: <span class="ruby-keyword kw">end</span> +323: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000066" class="method-detail"> - <a name="M000066"></a> + <div id="method-M000072" class="method-detail"> + <a name="M000072"></a> <div class="method-heading"> - <a href="#M000066" class="method-signature"> - <span class="method-name">elem</span><span class="method-args">()</span> + <a href="#M000072" class="method-signature"> + <span class="method-name">elem</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">elem &#8212; :</td><td>a -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000066-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000066-source"> + onclick="toggleCode('M000072-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000072-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 359</span> -359: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem</span> -360: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -361: <span class="ruby-keyword kw">return</span> [] -362: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 379</span> +379: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem</span>(<span class="ruby-identifier">list</span>) +380: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +381: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +382: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000072" class="method-detail"> - <a name="M000072"></a> + <div id="method-M000080" class="method-detail"> + <a name="M000080"></a> <div class="method-heading"> - <span class="method-name">elemIndex</span><span class="method-args">()</span> + <span class="method-name">elemIndex</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000071">elem_index</a> +Alias for <a href="List.html#M000079">elem_index</a> </p> </div> </div> - <div id="method-M000074" class="method-detail"> - <a name="M000074"></a> + <div id="method-M000082" class="method-detail"> + <a name="M000082"></a> <div class="method-heading"> - <span class="method-name">elemIndices</span><span class="method-args">()</span> + <span class="method-name">elemIndices</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000073">elem_indices</a> +Alias for <a href="List.html#M000081">elem_indices</a> </p> </div> </div> - <div id="method-M000071" class="method-detail"> - <a name="M000071"></a> + <div id="method-M000079" class="method-detail"> + <a name="M000079"></a> <div class="method-heading"> - <a href="#M000071" class="method-signature"> - <span class="method-name">elem_index</span><span class="method-args">()</span> + <a href="#M000079" class="method-signature"> + <span class="method-name">elem_index</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">elemIndex &#8212; :</td><td>(Eq a) =&gt; a -&gt; [a] -&gt; Maybe Int </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000071-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000071-source"> + onclick="toggleCode('M000079-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000079-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 393</span> -393: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem_index</span> -394: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem_index' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -395: <span class="ruby-keyword kw">return</span> [] -396: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 425</span> +425: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem_index</span>(<span class="ruby-identifier">list</span>) +426: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem_index' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +427: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +428: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000073" class="method-detail"> - <a name="M000073"></a> + <div id="method-M000081" class="method-detail"> + <a name="M000081"></a> <div class="method-heading"> - <a href="#M000073" class="method-signature"> - <span class="method-name">elem_indices</span><span class="method-args">()</span> + <a href="#M000081" class="method-signature"> + <span class="method-name">elem_indices</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">elemIndices &#8212; :</td><td>(Eq a) =&gt; a -&gt; [a] -&gt; [Int] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000073-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000073-source"> + onclick="toggleCode('M000081-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000081-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 400</span> -400: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem_indices</span> -401: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem_indices' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -402: <span class="ruby-keyword kw">return</span> [] -403: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 433</span> +433: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">elem_indices</span>(<span class="ruby-identifier">list</span>) +434: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'elem_indices' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +435: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +436: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000018" class="method-detail"> - <a name="M000018"></a> + <div id="method-M000077" class="method-detail"> + <a name="M000077"></a> <div class="method-heading"> - <a href="#M000018" class="method-signature"> - <span class="method-name">f_foldl</span><span class="method-args">(s, &amp;block)</span> + <a href="#M000077" class="method-signature"> + <span class="method-name">filter</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> - <p> -Classic recursive functional definition causes stack overflow for arrays of -any usable size&#8230; So don&#8217;t use it, it&#8217;s here for -demonstration purposes only. Use <a href="List.html#M000019">foldl</a>. -</p> + <table> +<tr><td valign="top">filter &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; [a] + +</td></tr> +</table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000018-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000018-source"> + onclick="toggleCode('M000077-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000077-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 90</span> -90: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">f_foldl</span>(<span class="ruby-identifier">s</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -91: <span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-identifier">s</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">tail</span>.<span class="ruby-identifier">f_foldl</span>(<span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">head</span>), <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -92: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 407</span> +407: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">filter</span>(<span class="ruby-identifier">list</span>) +408: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'filter' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +409: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +410: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000070" class="method-detail"> - <a name="M000070"></a> + <div id="method-M000076" class="method-detail"> + <a name="M000076"></a> <div class="method-heading"> - <a href="#M000070" class="method-signature"> - <span class="method-name">filter</span><span class="method-args">()</span> + <a href="#M000076" class="method-signature"> + <span class="method-name">find</span><span class="method-args">(p, list)</span> </a> </div> <div class="method-description"> <table> -<tr><td valign="top">filter &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; [a] +<tr><td valign="top">find &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; Maybe a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000070-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000070-source"> + onclick="toggleCode('M000076-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000076-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 380</span> -380: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">filter</span> -381: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'filter' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -382: <span class="ruby-keyword kw">return</span> [] -383: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 401</span> +401: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>) +402: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'find' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +403: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +404: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000076" class="method-detail"> - <a name="M000076"></a> + <div id="method-M000084" class="method-detail"> + <a name="M000084"></a> <div class="method-heading"> - <span class="method-name">findIndex</span><span class="method-args">()</span> + <span class="method-name">findIndex</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000075">find_index</a> +Alias for <a href="List.html#M000083">find_index</a> </p> </div> </div> - <div id="method-M000078" class="method-detail"> - <a name="M000078"></a> + <div id="method-M000086" class="method-detail"> + <a name="M000086"></a> <div class="method-heading"> - <span class="method-name">findIndices</span><span class="method-args">()</span> + <span class="method-name">findIndices</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000077">find_indices</a> +Alias for <a href="List.html#M000085">find_indices</a> </p> </div> </div> - <div id="method-M000075" class="method-detail"> - <a name="M000075"></a> + <div id="method-M000083" class="method-detail"> + <a name="M000083"></a> <div class="method-heading"> - <a href="#M000075" class="method-signature"> - <span class="method-name">find_index</span><span class="method-args">()</span> + <a href="#M000083" class="method-signature"> + <span class="method-name">find_index</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">findIndex &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; Maybe Int </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000075-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000075-source"> + onclick="toggleCode('M000083-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000083-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 407</span> -407: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_index</span> -408: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'find_index' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -409: <span class="ruby-keyword kw">return</span> [] -410: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 441</span> +441: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_index</span>(<span class="ruby-identifier">list</span>) +442: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'find_index' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +443: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +444: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000077" class="method-detail"> - <a name="M000077"></a> + <div id="method-M000085" class="method-detail"> + <a name="M000085"></a> <div class="method-heading"> - <a href="#M000077" class="method-signature"> - <span class="method-name">find_indices</span><span class="method-args">()</span> + <a href="#M000085" class="method-signature"> + <span class="method-name">find_indices</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">findIndices &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; [Int] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000077-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000077-source"> + onclick="toggleCode('M000085-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000085-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 414</span> -414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_indices</span> -415: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'find_indices' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -416: <span class="ruby-keyword kw">return</span> [] -417: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 449</span> +449: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_indices</span>(<span class="ruby-identifier">list</span>) +450: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'find_indices' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +451: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +452: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000019" class="method-detail"> - <a name="M000019"></a> + <div id="method-M000026" class="method-detail"> + <a name="M000026"></a> <div class="method-heading"> - <a href="#M000019" class="method-signature"> - <span class="method-name">foldl</span><span class="method-args">(s, &amp;block)</span> + <a href="#M000026" class="method-signature"> + <span class="method-name">foldl</span><span class="method-args">(f, a, list)</span> </a> </div> <div class="method-description"> - <p> -This is a more pedestrian iterative version of <a -href="List.html#M000018">f_foldl</a> -</p> -<table> + <table> <tr><td valign="top">foldl &#8212; :</td><td>(a -&gt; b -&gt; a) -&gt; a -&gt; [b] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000019-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000019-source"> + onclick="toggleCode('M000026-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000026-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 96</span> -96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl</span>(<span class="ruby-identifier">s</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -97: <span class="ruby-identifier">inject</span>(<span class="ruby-identifier">s</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span>) } -98: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 113</span> +113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">a</span>, <span class="ruby-identifier">list</span>) +114: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +115: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">a</span> } +116: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">f</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">foldl</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">a</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)), <span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)] } +117: <span class="ruby-keyword kw">end</span> +118: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000021" class="method-detail"> - <a name="M000021"></a> + <div id="method-M000028" class="method-detail"> + <a name="M000028"></a> <div class="method-heading"> - <a href="#M000021" class="method-signature"> - <span class="method-name">foldl1</span><span class="method-args">(&amp;block)</span> + <a href="#M000028" class="method-signature"> + <span class="method-name">foldl1</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">foldl1 &#8212; :</td><td>(a -&gt; a -&gt; a) -&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000021-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000021-source"> + onclick="toggleCode('M000028-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000028-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 107</span> -107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl1</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -108: <span class="ruby-identifier">tail</span>.<span class="ruby-identifier">foldl</span>(<span class="ruby-identifier">head</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -109: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 127</span> +127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl1</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +128: <span class="ruby-identifier">foldl</span>(<span class="ruby-identifier">f</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>), <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) +129: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000022" class="method-detail"> - <a name="M000022"></a> + <div id="method-M000029" class="method-detail"> + <a name="M000029"></a> <div class="method-heading"> - <a href="#M000022" class="method-signature"> - <span class="method-name">foldl1_</span><span class="method-args">()</span> + <a href="#M000029" class="method-signature"> + <span class="method-name">foldl1_</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">foldl1&#8217; &#8212; :</td><td>(a -&gt; a -&gt; a) -&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000022-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000022-source"> + onclick="toggleCode('M000029-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000029-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 112</span> -112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl1_</span> -113: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'foldl1_' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -114: <span class="ruby-keyword kw">return</span> [] -115: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 132</span> +132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl1_</span>(<span class="ruby-identifier">list</span>) +133: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'foldl1_' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +134: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +135: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000020" class="method-detail"> - <a name="M000020"></a> + <div id="method-M000027" class="method-detail"> + <a name="M000027"></a> <div class="method-heading"> - <a href="#M000020" class="method-signature"> - <span class="method-name">foldl_</span><span class="method-args">()</span> + <a href="#M000027" class="method-signature"> + <span class="method-name">foldl_</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">foldl&#8217; &#8212; :</td><td>(a -&gt; b -&gt; a) -&gt; a -&gt; [b] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000020-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000020-source"> + onclick="toggleCode('M000027-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000027-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 101</span> -101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl_</span> -102: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'foldl_' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -103: <span class="ruby-keyword kw">return</span> [] -104: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 121</span> +121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldl_</span>(<span class="ruby-identifier">list</span>) +122: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'foldl_' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +123: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +124: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000023" class="method-detail"> - <a name="M000023"></a> + <div id="method-M000030" class="method-detail"> + <a name="M000030"></a> <div class="method-heading"> - <a href="#M000023" class="method-signature"> - <span class="method-name">foldr</span><span class="method-args">(s, &amp;block)</span> + <a href="#M000030" class="method-signature"> + <span class="method-name">foldr</span><span class="method-args">(f, s, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">foldr &#8212; :</td><td>(a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000023-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000023-source"> + onclick="toggleCode('M000030-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000030-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 118</span> -118: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">s</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -119: <span class="ruby-identifier">inject</span>(<span class="ruby-identifier">s</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">b</span>, <span class="ruby-identifier">a</span>) } -120: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 138</span> +138: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">s</span>, <span class="ruby-identifier">list</span>) +139: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +140: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">s</span> } +141: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">f</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>), <span class="ruby-operator">~</span><span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">s</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>))] } +142: <span class="ruby-keyword kw">end</span> +143: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000024" class="method-detail"> - <a name="M000024"></a> + <div id="method-M000031" class="method-detail"> + <a name="M000031"></a> <div class="method-heading"> - <a href="#M000024" class="method-signature"> - <span class="method-name">foldr1</span><span class="method-args">(&amp;block)</span> + <a href="#M000031" class="method-signature"> + <span class="method-name">foldr1</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">foldr1 &#8212; :</td><td>(a -&gt; a -&gt; a) -&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000024-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000024-source"> + onclick="toggleCode('M000031-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000031-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 123</span> -123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldr1</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -124: <span class="ruby-identifier">tail</span>.<span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">head</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -125: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 146</span> +146: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foldr1</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +147: <span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">f</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>), <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) +148: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000059" class="method-detail"> - <a name="M000059"></a> + <div id="method-M000065" class="method-detail"> + <a name="M000065"></a> <div class="method-heading"> - <a href="#M000059" class="method-signature"> - <span class="method-name">group</span><span class="method-args">()</span> + <a href="#M000065" class="method-signature"> + <span class="method-name">group</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">group &#8212; :</td><td>Eq a =&gt; [a] -&gt; [[a]] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000059-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000059-source"> + onclick="toggleCode('M000065-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000065-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 321</span> -321: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group</span> -322: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'group' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -323: <span class="ruby-keyword kw">return</span> [] -324: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 339</span> +339: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group</span>(<span class="ruby-identifier">list</span>) +340: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'group' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +341: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +342: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000013" class="method-detail"> - <a name="M000013"></a> + <div id="method-M000016" class="method-detail"> + <a name="M000016"></a> <div class="method-heading"> - <a href="#M000013" class="method-signature"> - <span class="method-name">head</span><span class="method-args">()</span> + <a href="#M000016" class="method-signature"> + <span class="method-name">head</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">head &#8212; :</td><td>[a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000013-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000013-source"> + onclick="toggleCode('M000016-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000016-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 60</span> -60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span> -61: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span>] -62: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 36</span> +36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>) +37: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +38: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">empty_list_error</span> +39: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>[<span class="ruby-value">0</span>] } +40: <span class="ruby-keyword kw">end</span> +41: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000015" class="method-detail"> - <a name="M000015"></a> + <div id="method-M000019" class="method-detail"> + <a name="M000019"></a> <div class="method-heading"> - <a href="#M000015" class="method-signature"> - <span class="method-name">init</span><span class="method-args">()</span> + <a href="#M000019" class="method-signature"> + <span class="method-name">init</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">init &#8212; :</td><td>[a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000015-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000015-source"> + onclick="toggleCode('M000019-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000019-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 70</span> -70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init</span> -71: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] -72: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 61</span> +61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init</span>(<span class="ruby-identifier">list</span>) +62: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +63: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">empty_list_error</span> +64: <span class="ruby-keyword kw">when</span> [<span class="ruby-identifier">list</span>[<span class="ruby-value">0</span>]] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { [] } +65: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { [<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)]<span class="ruby-operator">+</span><span class="ruby-operator">~</span><span class="ruby-identifier">init</span>(<span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) } +66: <span class="ruby-keyword kw">end</span> +67: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000060" class="method-detail"> - <a name="M000060"></a> + <div id="method-M000066" class="method-detail"> + <a name="M000066"></a> <div class="method-heading"> - <a href="#M000060" class="method-signature"> - <span class="method-name">inits</span><span class="method-args">()</span> + <a href="#M000066" class="method-signature"> + <span class="method-name">inits</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">inits &#8212; :</td><td>[a] -&gt; [[a]] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000060-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000060-source"> + onclick="toggleCode('M000066-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000066-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 327</span> -327: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inits</span> -328: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'inits' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -329: <span class="ruby-keyword kw">return</span> [] -330: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 345</span> +345: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inits</span>(<span class="ruby-identifier">list</span>) +346: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'inits' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +347: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +348: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000098" class="method-detail"> - <a name="M000098"></a> + <div id="method-M000108" class="method-detail"> + <a name="M000108"></a> <div class="method-heading"> - <a href="#M000098" class="method-signature"> - <span class="method-name">insert</span><span class="method-args">(o)</span> + <a href="#M000108" class="method-signature"> + <span class="method-name">insert</span><span class="method-args">(o, list)</span> </a> </div> <div class="method-description"> - <p> -Implemented by Array but semantics is different -</p> -<table> + <table> <tr><td valign="top">insert &#8212; :</td><td>(Ord a) =&gt; a -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000098-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000098-source"> + onclick="toggleCode('M000108-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000108-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 537</span> -537: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">o</span>) -538: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'insert' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -539: <span class="ruby-keyword kw">return</span> [] -540: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 581</span> +581: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">o</span>, <span class="ruby-identifier">list</span>) +582: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'insert' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +583: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +584: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000097" class="method-detail"> - <a name="M000097"></a> + <div id="method-M000106" class="method-detail"> + <a name="M000106"></a> <div class="method-heading"> - <a href="#M000097" class="method-signature"> - <span class="method-name">intersect</span><span class="method-args">()</span> + <a href="#M000106" class="method-signature"> + <span class="method-name">intersect</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">intersect &#8212; :</td><td>(Eq a) =&gt; [a] -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000097-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000097-source"> + onclick="toggleCode('M000106-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000106-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 528</span> -528: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intersect</span> -529: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'intersect' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -530: <span class="ruby-keyword kw">return</span> [] -531: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 567</span> +567: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intersect</span>(<span class="ruby-identifier">list</span>) +568: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'intersect' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +569: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +570: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000017" class="method-detail"> - <a name="M000017"></a> + <div id="method-M000024" class="method-detail"> + <a name="M000024"></a> <div class="method-heading"> - <a href="#M000017" class="method-signature"> - <span class="method-name">intersperse</span><span class="method-args">()</span> + <a href="#M000024" class="method-signature"> + <span class="method-name">intersperse</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">intersperse &#8212; :</td><td>a -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000017-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000017-source"> + onclick="toggleCode('M000024-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000024-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 80</span> -80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intersperse</span> -81: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'intersperse' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -82: <span class="ruby-keyword kw">return</span> [] -83: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 99</span> + 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intersperse</span>(<span class="ruby-identifier">list</span>) +100: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'intersperse' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +101: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +102: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000063" class="method-detail"> - <a name="M000063"></a> + <div id="method-M000069" class="method-detail"> + <a name="M000069"></a> <div class="method-heading"> - <span class="method-name">isPrefixOf</span><span class="method-args">()</span> + <span class="method-name">isPrefixOf</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000062">is_prefix_of</a> +Alias for <a href="List.html#M000068">is_prefix_of</a> </p> </div> </div> - <div id="method-M000065" class="method-detail"> - <a name="M000065"></a> + <div id="method-M000071" class="method-detail"> + <a name="M000071"></a> <div class="method-heading"> - <span class="method-name">isSuffixOf</span><span class="method-args">()</span> + <span class="method-name">isSuffixOf</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000064">is_suffix_of</a> +Alias for <a href="List.html#M000070">is_suffix_of</a> </p> </div> </div> - <div id="method-M000062" class="method-detail"> - <a name="M000062"></a> + <div id="method-M000068" class="method-detail"> + <a name="M000068"></a> <div class="method-heading"> - <a href="#M000062" class="method-signature"> - <span class="method-name">is_prefix_of</span><span class="method-args">()</span> + <a href="#M000068" class="method-signature"> + <span class="method-name">is_prefix_of</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">isPrefixOf &#8212; :</td><td>(Eq a) =&gt; [a] -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000062-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000062-source"> + onclick="toggleCode('M000068-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000068-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 341</span> -341: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_prefix_of</span> -342: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'is_prefix_of' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -343: <span class="ruby-keyword kw">return</span> [] -344: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 359</span> +359: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_prefix_of</span>(<span class="ruby-identifier">list</span>) +360: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'is_prefix_of' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +361: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +362: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000064" class="method-detail"> - <a name="M000064"></a> + <div id="method-M000070" class="method-detail"> + <a name="M000070"></a> <div class="method-heading"> - <a href="#M000064" class="method-signature"> - <span class="method-name">is_suffix_of</span><span class="method-args">()</span> + <a href="#M000070" class="method-signature"> + <span class="method-name">is_suffix_of</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">isSuffixOf &#8212; :</td><td>(Eq a) =&gt; [a] -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000064-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000064-source"> + onclick="toggleCode('M000070-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000070-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 348</span> -348: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_suffix_of</span> -349: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'is_suffix_of' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -350: <span class="ruby-keyword kw">return</span> [] -351: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 367</span> +367: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_suffix_of</span>(<span class="ruby-identifier">list</span>) +368: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'is_suffix_of' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +369: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +370: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000044" class="method-detail"> - <a name="M000044"></a> + <div id="method-M000051" class="method-detail"> + <a name="M000051"></a> <div class="method-heading"> - <a href="#M000044" class="method-signature"> - <span class="method-name">iterate</span><span class="method-args">()</span> + <a href="#M000051" class="method-signature"> + <span class="method-name">iterate</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">iterate &#8212; :</td><td>(a -&gt; a) -&gt; a -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000044-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000044-source"> + onclick="toggleCode('M000051-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000051-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 234</span> -234: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">iterate</span> -235: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'iterate' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -236: <span class="ruby-keyword kw">return</span> [] -237: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 257</span> +257: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">iterate</span>(<span class="ruby-identifier">list</span>) +258: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'iterate' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +259: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +260: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000090" class="method-detail"> - <a name="M000090"></a> + <div id="method-M000018" class="method-detail"> + <a name="M000018"></a> <div class="method-heading"> - <a href="#M000090" class="method-signature"> - <span class="method-name">lines</span><span class="method-args">()</span> + <a href="#M000018" class="method-signature"> + <span class="method-name">last</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> +<tr><td valign="top">last &#8212; :</td><td>[a] -&gt; a + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000018-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000018-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 52</span> +52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last</span>(<span class="ruby-identifier">list</span>) +53: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +54: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">empty_list_error</span> +55: <span class="ruby-keyword kw">when</span> [<span class="ruby-identifier">list</span>[<span class="ruby-value">0</span>]] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>[<span class="ruby-value">0</span>] } +56: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">last</span>(<span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) +57: <span class="ruby-keyword kw">end</span> +58: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000021" class="method-detail"> + <a name="M000021"></a> + + <div class="method-heading"> + <a href="#M000021" class="method-signature"> + <span class="method-name">length</span><span class="method-args">(list)</span> + </a> + </div> + + <div class="method-description"> + <table> +<tr><td valign="top">length &#8212; :</td><td>[a] -&gt; Int + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000021-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000021-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 75</span> +75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">length</span>(<span class="ruby-identifier">list</span>) +76: <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> } +77: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000099" class="method-detail"> + <a name="M000099"></a> + + <div class="method-heading"> + <a href="#M000099" class="method-signature"> + <span class="method-name">lines</span><span class="method-args">(list)</span> + </a> + </div> + + <div class="method-description"> + <table> <tr><td valign="top">lines &#8212; :</td><td>String -&gt; [String] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000090-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000090-source"> + onclick="toggleCode('M000099-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000099-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 482</span> -482: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lines</span> -483: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'lines' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -484: <span class="ruby-keyword kw">return</span> [] -485: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 523</span> +523: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lines</span>(<span class="ruby-identifier">list</span>) +524: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'lines' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +525: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +526: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000069" class="method-detail"> - <a name="M000069"></a> + <div id="method-M000075" class="method-detail"> + <a name="M000075"></a> <div class="method-heading"> - <a href="#M000069" class="method-signature"> - <span class="method-name">lookup</span><span class="method-args">()</span> + <a href="#M000075" class="method-signature"> + <span class="method-name">lookup</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">lookup &#8212; :</td><td>(Eq a) =&gt; a -&gt; [(a,b)] -&gt; Maybe b </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000069-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000069-source"> + onclick="toggleCode('M000075-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000075-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 372</span> -372: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup</span> -373: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'lookup' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -374: <span class="ruby-keyword kw">return</span> [] -375: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 393</span> +393: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">list</span>) +394: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'lookup' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +395: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +396: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000041" class="method-detail"> - <a name="M000041"></a> + <div id="method-M000022" class="method-detail"> + <a name="M000022"></a> <div class="method-heading"> - <span class="method-name">mapAccumL</span><span class="method-args">()</span> + <a href="#M000022" class="method-signature"> + <span class="method-name">map</span><span class="method-args">(f, list)</span> + </a> </div> <div class="method-description"> + <table> +<tr><td valign="top">map &#8212; :</td><td>(a -&gt; b) -&gt; [a] -&gt; [b] + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000022-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000022-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 80</span> +80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +81: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +82: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span>{ [] } +83: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span>{ [ <span class="ruby-identifier">f</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)] ] <span class="ruby-operator">+</span> <span class="ruby-operator">~</span><span class="ruby-identifier">map</span>(<span class="ruby-identifier">f</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) } +84: <span class="ruby-keyword kw">end</span> +85: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000048" class="method-detail"> + <a name="M000048"></a> + + <div class="method-heading"> + <span class="method-name">mapAccumL</span><span class="method-args">(list)</span> + </div> + + <div class="method-description"> <p> -Alias for <a href="List.html#M000040">map_accum_l</a> +Alias for <a href="List.html#M000047">map_accum_l</a> </p> </div> </div> - <div id="method-M000043" class="method-detail"> - <a name="M000043"></a> + <div id="method-M000050" class="method-detail"> + <a name="M000050"></a> <div class="method-heading"> - <span class="method-name">mapAccumR</span><span class="method-args">()</span> + <span class="method-name">mapAccumR</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000042">map_accum_r</a> +Alias for <a href="List.html#M000049">map_accum_r</a> </p> </div> </div> - <div id="method-M000040" class="method-detail"> - <a name="M000040"></a> + <div id="method-M000047" class="method-detail"> + <a name="M000047"></a> <div class="method-heading"> - <a href="#M000040" class="method-signature"> - <span class="method-name">map_accum_l</span><span class="method-args">()</span> + <a href="#M000047" class="method-signature"> + <span class="method-name">map_accum_l</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">mapAccumL &#8212; :</td><td>(a -&gt; b -&gt; (a,c)) -&gt; a -&gt; [b] -&gt; (a,[c]) </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000040-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000040-source"> + onclick="toggleCode('M000047-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000047-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 217</span> -217: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_accum_l</span> -218: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'map_accum_l' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -219: <span class="ruby-keyword kw">return</span> [] -220: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 239</span> +239: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_accum_l</span>(<span class="ruby-identifier">list</span>) +240: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'map_accum_l' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +241: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +242: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000042" class="method-detail"> - <a name="M000042"></a> + <div id="method-M000049" class="method-detail"> + <a name="M000049"></a> <div class="method-heading"> - <a href="#M000042" class="method-signature"> - <span class="method-name">map_accum_r</span><span class="method-args">()</span> + <a href="#M000049" class="method-signature"> + <span class="method-name">map_accum_r</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">mapAccumR &#8212; :</td><td>(a -&gt; b -&gt; (a,c)) -&gt; a -&gt; [b] -&gt; (a,[c]) </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000042-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000042-source"> + onclick="toggleCode('M000049-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000049-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 224</span> -224: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_accum_r</span> -225: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'map_accum_r' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -226: <span class="ruby-keyword kw">return</span> [] -227: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 247</span> +247: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_accum_r</span>(<span class="ruby-identifier">list</span>) +248: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'map_accum_r' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +249: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +250: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000034" class="method-detail"> - <a name="M000034"></a> + <div id="method-M000041" class="method-detail"> + <a name="M000041"></a> <div class="method-heading"> - <a href="#M000034" class="method-signature"> - <span class="method-name">maximum</span><span class="method-args">()</span> + <a href="#M000041" class="method-signature"> + <span class="method-name">maximum</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">maximum &#8212; :</td><td>(Ord a) =&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000034-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000034-source"> + onclick="toggleCode('M000041-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000041-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 177</span> -177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">maximum</span> -178: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'maximum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -179: <span class="ruby-keyword kw">return</span> [] -180: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 197</span> +197: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">maximum</span>(<span class="ruby-identifier">list</span>) +198: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'maximum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +199: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +200: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000035" class="method-detail"> - <a name="M000035"></a> + <div id="method-M000042" class="method-detail"> + <a name="M000042"></a> <div class="method-heading"> - <a href="#M000035" class="method-signature"> - <span class="method-name">minimum</span><span class="method-args">()</span> + <a href="#M000042" class="method-signature"> + <span class="method-name">minimum</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">minimum &#8212; :</td><td>(Ord a) =&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000035-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000035-source"> + onclick="toggleCode('M000042-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000042-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 183</span> -183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">minimum</span> -184: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'minimum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -185: <span class="ruby-keyword kw">return</span> [] -186: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 203</span> +203: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">minimum</span>(<span class="ruby-identifier">list</span>) +204: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'minimum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +205: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +206: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000068" class="method-detail"> - <a name="M000068"></a> + <div id="method-M000074" class="method-detail"> + <a name="M000074"></a> <div class="method-heading"> - <span class="method-name">notElem</span><span class="method-args">()</span> + <span class="method-name">notElem</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000067">not_elem</a> +Alias for <a href="List.html#M000073">not_elem</a> </p> </div> </div> - <div id="method-M000067" class="method-detail"> - <a name="M000067"></a> + <div id="method-M000073" class="method-detail"> + <a name="M000073"></a> <div class="method-heading"> - <a href="#M000067" class="method-signature"> - <span class="method-name">not_elem</span><span class="method-args">()</span> + <a href="#M000073" class="method-signature"> + <span class="method-name">not_elem</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">notElem &#8212; :</td><td>a -&gt; [a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000067-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000067-source"> + onclick="toggleCode('M000073-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000073-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 365</span> -365: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_elem</span> -366: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'not_elem' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -367: <span class="ruby-keyword kw">return</span> [] -368: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 385</span> +385: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_elem</span>(<span class="ruby-identifier">list</span>) +386: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'not_elem' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +387: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +388: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000094" class="method-detail"> - <a name="M000094"></a> + <div id="method-M000103" class="method-detail"> + <a name="M000103"></a> <div class="method-heading"> - <a href="#M000094" class="method-signature"> - <span class="method-name">nub</span><span class="method-args">()</span> + <a href="#M000103" class="method-signature"> + <span class="method-name">nub</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">nub &#8212; :</td><td>(Eq a) =&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000094-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000094-source"> + onclick="toggleCode('M000103-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000103-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 509</span> -509: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nub</span> -510: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'nub' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -511: <span class="ruby-keyword kw">return</span> [] -512: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 549</span> +549: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nub</span>(<span class="ruby-identifier">list</span>) +550: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'nub' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +551: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +552: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000016" class="method-detail"> - <a name="M000016"></a> + <div id="method-M000020" class="method-detail"> + <a name="M000020"></a> <div class="method-heading"> - <a href="#M000016" class="method-signature"> - <span class="method-name">null</span><span class="method-args">()</span> + <a href="#M000020" class="method-signature"> + <span class="method-name">null</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">null &#8212; :</td><td>[a] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000016-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000016-source"> + onclick="toggleCode('M000020-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000020-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 75</span> -75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">null</span> -76: <span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> -77: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 70</span> +70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">null</span>(<span class="ruby-identifier">list</span>) +71: <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> } +72: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000029" class="method-detail"> - <a name="M000029"></a> + <div id="method-M000036" class="method-detail"> + <a name="M000036"></a> <div class="method-heading"> - <a href="#M000029" class="method-signature"> - <span class="method-name">or</span><span class="method-args">()</span> + <a href="#M000036" class="method-signature"> + <span class="method-name">or_</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">or &#8212; :</td><td>[Bool] -&gt; Bool </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000029-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000029-source"> + onclick="toggleCode('M000036-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000036-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 148</span> -148: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">or</span> -149: <span class="ruby-identifier">foldr</span>(<span class="ruby-keyword kw">false</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">x</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">y</span>)} -150: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 170</span> +170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">or_</span>(<span class="ruby-identifier">list</span>) +171: <span class="ruby-identifier">foldr</span>(<span class="ruby-identifier">lambda</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">x</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">y</span>)}, <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">list</span>) +172: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000033" class="method-detail"> - <a name="M000033"></a> + <div id="method-M000078" class="method-detail"> + <a name="M000078"></a> <div class="method-heading"> - <a href="#M000033" class="method-signature"> - <span class="method-name">product</span><span class="method-args">()</span> + <a href="#M000078" class="method-signature"> + <span class="method-name">partition</span><span class="method-args">(p, list)</span> </a> </div> <div class="method-description"> <table> +<tr><td valign="top">partition &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a]) + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000078-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000078-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 413</span> +413: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partition</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>) +414: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'partition' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +415: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +416: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000040" class="method-detail"> + <a name="M000040"></a> + + <div class="method-heading"> + <a href="#M000040" class="method-signature"> + <span class="method-name">product</span><span class="method-args">(list)</span> + </a> + </div> + + <div class="method-description"> + <table> <tr><td valign="top">product &#8212; :</td><td>(Num a) =&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000033-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000033-source"> + onclick="toggleCode('M000040-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000040-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 171</span> -171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">product</span> -172: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'product' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -173: <span class="ruby-keyword kw">return</span> [] -174: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 191</span> +191: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">product</span>(<span class="ruby-identifier">list</span>) +192: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'product' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +193: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +194: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000045" class="method-detail"> - <a name="M000045"></a> + <div id="method-M000052" class="method-detail"> + <a name="M000052"></a> <div class="method-heading"> - <a href="#M000045" class="method-signature"> - <span class="method-name">repeat</span><span class="method-args">()</span> + <a href="#M000052" class="method-signature"> + <span class="method-name">repeat</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">repeat &#8212; :</td><td>a -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000045-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000045-source"> + onclick="toggleCode('M000052-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000052-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 240</span> -240: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">repeat</span> -241: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'repeat' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -242: <span class="ruby-keyword kw">return</span> [] -243: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 263</span> +263: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">repeat</span>(<span class="ruby-identifier">list</span>) +264: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'repeat' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +265: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +266: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000046" class="method-detail"> - <a name="M000046"></a> + <div id="method-M000053" class="method-detail"> + <a name="M000053"></a> <div class="method-heading"> - <a href="#M000046" class="method-signature"> - <span class="method-name">replicate</span><span class="method-args">()</span> + <a href="#M000053" class="method-signature"> + <span class="method-name">replicate</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">replicate &#8212; :</td><td>Int -&gt; a -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000046-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000046-source"> + onclick="toggleCode('M000053-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000053-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 246</span> -246: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replicate</span> -247: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'replicate' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -248: <span class="ruby-keyword kw">return</span> [] -249: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 269</span> +269: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replicate</span>(<span class="ruby-identifier">list</span>) +270: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'replicate' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +271: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +272: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000036" class="method-detail"> - <a name="M000036"></a> + <div id="method-M000023" class="method-detail"> + <a name="M000023"></a> <div class="method-heading"> - <a href="#M000036" class="method-signature"> - <span class="method-name">scanl</span><span class="method-args">(s, &amp;block)</span> + <a href="#M000023" class="method-signature"> + <span class="method-name">reverse</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> +<tr><td valign="top">, reverse &#8212; :</td><td>[a] -&gt; [a] + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000023-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000023-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 88</span> +88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reverse</span>(<span class="ruby-identifier">list</span>) +89: <span class="ruby-identifier">r</span> = <span class="ruby-identifier">proc</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span>, <span class="ruby-identifier">a</span><span class="ruby-operator">|</span> +90: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">l</span> +91: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">a</span> } +92: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">~</span><span class="ruby-identifier">r</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">l</span>), [<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">l</span>)]<span class="ruby-operator">+</span><span class="ruby-identifier">a</span>] } +93: <span class="ruby-keyword kw">end</span> +94: } +95: <span class="ruby-identifier">r</span>[<span class="ruby-identifier">list</span>, []] +96: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000043" class="method-detail"> + <a name="M000043"></a> + + <div class="method-heading"> + <a href="#M000043" class="method-signature"> + <span class="method-name">scanl</span><span class="method-args">(f, s, list)</span> + </a> + </div> + + <div class="method-description"> + <table> <tr><td valign="top">scanl &#8212; :</td><td>(a -&gt; b -&gt; a) -&gt; a -&gt; [b] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000036-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000036-source"> + onclick="toggleCode('M000043-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000043-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 194</span> -194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanl</span>(<span class="ruby-identifier">s</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -195: <span class="ruby-identifier">inject</span>([<span class="ruby-identifier">s</span>]){ <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">last</span>,<span class="ruby-identifier">b</span>) } -196: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 213</span> +213: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanl</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">s</span>, <span class="ruby-identifier">list</span>) +214: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'scanl' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +215: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +216: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000037" class="method-detail"> - <a name="M000037"></a> + <div id="method-M000044" class="method-detail"> + <a name="M000044"></a> <div class="method-heading"> - <a href="#M000037" class="method-signature"> - <span class="method-name">scanl1</span><span class="method-args">(&amp;block)</span> + <a href="#M000044" class="method-signature"> + <span class="method-name">scanl1</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">scanl1 &#8212; :</td><td>(a -&gt; a -&gt; a) -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000037-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000037-source"> + onclick="toggleCode('M000044-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000044-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 199</span> -199: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanl1</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -200: <span class="ruby-identifier">tail</span>.<span class="ruby-identifier">scanl</span>(<span class="ruby-identifier">head</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -201: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 219</span> +219: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanl1</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +220: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'scanl1' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +221: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +222: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000038" class="method-detail"> - <a name="M000038"></a> + <div id="method-M000045" class="method-detail"> + <a name="M000045"></a> <div class="method-heading"> - <a href="#M000038" class="method-signature"> - <span class="method-name">scanr</span><span class="method-args">(s, &amp;block)</span> + <a href="#M000045" class="method-signature"> + <span class="method-name">scanr</span><span class="method-args">(f, s, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">scanr &#8212; :</td><td>(a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; [b] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000038-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000038-source"> + onclick="toggleCode('M000045-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000045-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 204</span> -204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanr</span>(<span class="ruby-identifier">s</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -205: <span class="ruby-identifier">inject</span>([<span class="ruby-identifier">s</span>]){ <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">b</span>, <span class="ruby-identifier">a</span>.<span class="ruby-identifier">last</span>) } -206: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 225</span> +225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanr</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">s</span>, <span class="ruby-identifier">list</span>) +226: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'scanr' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +227: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +228: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000039" class="method-detail"> - <a name="M000039"></a> + <div id="method-M000046" class="method-detail"> + <a name="M000046"></a> <div class="method-heading"> - <a href="#M000039" class="method-signature"> - <span class="method-name">scanr1</span><span class="method-args">(&amp;block)</span> + <a href="#M000046" class="method-signature"> + <span class="method-name">scanr1</span><span class="method-args">(f, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">scanr1 &#8212; :</td><td>(a -&gt; a -&gt; a) -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000039-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000039-source"> + onclick="toggleCode('M000046-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000046-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 209</span> -209: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanr1</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -210: <span class="ruby-identifier">tail</span>.<span class="ruby-identifier">scanr</span>(<span class="ruby-identifier">head</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -211: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 231</span> +231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scanr1</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">list</span>) +232: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'scanr1' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +233: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +234: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000057" class="method-detail"> - <a name="M000057"></a> + <div id="method-M000107" class="method-detail"> + <a name="M000107"></a> <div class="method-heading"> - <a href="#M000057" class="method-signature"> - <span class="method-name">span</span><span class="method-args">(&amp;block)</span> + <a href="#M000107" class="method-signature"> + <span class="method-name">sort</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> -<tr><td valign="top">span &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a]) +<tr><td valign="top">sort &#8212; :</td><td>(Ord a) =&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000057-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000057-source"> + onclick="toggleCode('M000107-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000107-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 310</span> -310: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">span</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) -311: [<span class="ruby-identifier">take_while</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>), <span class="ruby-identifier">drop_while</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)] -312: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 575</span> +575: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort</span>(<span class="ruby-identifier">list</span>) +576: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'sort' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +577: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +578: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000052" class="method-detail"> - <a name="M000052"></a> + <div id="method-M000063" class="method-detail"> + <a name="M000063"></a> <div class="method-heading"> - <span class="method-name">splitAt</span><span class="method-args">(n)</span> + <a href="#M000063" class="method-signature"> + <span class="method-name">span</span><span class="method-args">(p, list)</span> + </a> </div> <div class="method-description"> - <p> -Alias for <a href="List.html#M000051">split_at</a> -</p> + <table> +<tr><td valign="top">span &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; ([a], [a]) + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000063-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000063-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 328</span> +328: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">span</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>) +329: <span class="ruby-identifier">lambda</span> { [<span class="ruby-operator">~</span><span class="ruby-identifier">takeWhile</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>), <span class="ruby-operator">~</span><span class="ruby-identifier">dropWhile</span>(<span class="ruby-identifier">p</span>,<span class="ruby-identifier">list</span>)] } +330: <span class="ruby-keyword kw">end</span> +</pre> + </div> </div> </div> - <div id="method-M000051" class="method-detail"> - <a name="M000051"></a> + <div id="method-M000058" class="method-detail"> + <a name="M000058"></a> <div class="method-heading"> - <a href="#M000051" class="method-signature"> - <span class="method-name">split_at</span><span class="method-args">(n)</span> + <a href="#M000058" class="method-signature"> + <span class="method-name">split_at</span><span class="method-args">(n, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">splitAt &#8212; :</td><td>Int -&gt; [a] -&gt; ([a], [a]) </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000051-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000051-source"> + onclick="toggleCode('M000058-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000058-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 282</span> -282: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split_at</span>(<span class="ruby-identifier">n</span>) -283: [<span class="ruby-identifier">take</span>(<span class="ruby-identifier">n</span>), <span class="ruby-identifier">drop</span>(<span class="ruby-identifier">n</span>)] -284: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 303</span> +303: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split_at</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">list</span>) +304: <span class="ruby-identifier">lambda</span> { [<span class="ruby-operator">~</span><span class="ruby-identifier">take</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">list</span>), <span class="ruby-operator">~</span><span class="ruby-identifier">drop</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">list</span>)] } +305: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000032" class="method-detail"> - <a name="M000032"></a> + <div id="method-M000039" class="method-detail"> + <a name="M000039"></a> <div class="method-heading"> - <a href="#M000032" class="method-signature"> - <span class="method-name">sum</span><span class="method-args">()</span> + <a href="#M000039" class="method-signature"> + <span class="method-name">sum</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">sum &#8212; :</td><td>(Num a) =&gt; [a] -&gt; a </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000032-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000032-source"> + onclick="toggleCode('M000039-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000039-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 165</span> -165: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sum</span> -166: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'sum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -167: <span class="ruby-keyword kw">return</span> [] -168: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 185</span> +185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sum</span>(<span class="ruby-identifier">list</span>) +186: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'sum' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +187: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +188: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000014" class="method-detail"> - <a name="M000014"></a> + <div id="method-M000017" class="method-detail"> + <a name="M000017"></a> <div class="method-heading"> - <a href="#M000014" class="method-signature"> - <span class="method-name">tail</span><span class="method-args">()</span> + <a href="#M000017" class="method-signature"> + <span class="method-name">tail</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">tail &#8212; :</td><td>[a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000014-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000014-source"> + onclick="toggleCode('M000017-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000017-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 65</span> -65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tail</span> -66: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] -67: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 44</span> +44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>) +45: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +46: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">empty_list_error</span> +47: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] } +48: <span class="ruby-keyword kw">end</span> +49: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000061" class="method-detail"> - <a name="M000061"></a> + <div id="method-M000067" class="method-detail"> + <a name="M000067"></a> <div class="method-heading"> - <a href="#M000061" class="method-signature"> - <span class="method-name">tails</span><span class="method-args">()</span> + <a href="#M000067" class="method-signature"> + <span class="method-name">tails</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">tails &#8212; :</td><td>[a] -&gt; [[a]] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000061-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000061-source"> + onclick="toggleCode('M000067-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000067-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 333</span> -333: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tails</span> -334: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'tails' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -335: <span class="ruby-keyword kw">return</span> [] -336: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 351</span> +351: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tails</span>(<span class="ruby-identifier">list</span>) +352: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'tails' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +353: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +354: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000049" class="method-detail"> - <a name="M000049"></a> + <div id="method-M000056" class="method-detail"> + <a name="M000056"></a> <div class="method-heading"> - <a href="#M000049" class="method-signature"> - <span class="method-name">take</span><span class="method-args">(n)</span> + <a href="#M000056" class="method-signature"> + <span class="method-name">take</span><span class="method-args">(n, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">take &#8212; :</td><td>Int -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000049-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000049-source"> + onclick="toggleCode('M000056-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000056-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 272</span> -272: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take</span>(<span class="ruby-identifier">n</span>) -273: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">n</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)] -274: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 293</span> +293: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">list</span>) +294: <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">n</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)] } +295: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000054" class="method-detail"> - <a name="M000054"></a> + <div id="method-M000060" class="method-detail"> + <a name="M000060"></a> <div class="method-heading"> - <span class="method-name">takeWhile</span><span class="method-args">()</span> + <span class="method-name">takeWhile</span><span class="method-args">(p, list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000053">take_while</a> +Alias for <a href="List.html#M000059">take_while</a> </p> </div> </div> - <div id="method-M000053" class="method-detail"> - <a name="M000053"></a> + <div id="method-M000059" class="method-detail"> + <a name="M000059"></a> <div class="method-heading"> - <a href="#M000053" class="method-signature"> - <span class="method-name">take_while</span><span class="method-args">() {|e| ...}</span> + <a href="#M000059" class="method-signature"> + <span class="method-name">take_while</span><span class="method-args">(p, list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">takeWhile &#8212; :</td><td>(a -&gt; Bool) -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000053-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000053-source"> + onclick="toggleCode('M000059-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000059-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 288</span> -288: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take_while</span> -289: <span class="ruby-identifier">r</span> = [] -290: <span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> -291: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">e</span>) -292: <span class="ruby-identifier">r</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">e</span> -293: } -294: <span class="ruby-identifier">r</span> -295: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 308</span> +308: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take_while</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">list</span>) +309: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">list</span> +310: <span class="ruby-keyword kw">when</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { [] } +311: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">p</span>[<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)] <span class="ruby-operator">?</span> <span class="ruby-identifier">lambda</span> { [<span class="ruby-operator">~</span><span class="ruby-identifier">head</span>(<span class="ruby-identifier">list</span>)]<span class="ruby-operator">+</span> <span class="ruby-operator">~</span><span class="ruby-identifier">take_while</span>(<span class="ruby-identifier">p</span>, <span class="ruby-operator">~</span><span class="ruby-identifier">tail</span>(<span class="ruby-identifier">list</span>)) } <span class="ruby-operator">:</span> <span class="ruby-identifier">lambda</span> { [] } +312: <span class="ruby-keyword kw">end</span> +313: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000048" class="method-detail"> - <a name="M000048"></a> + <div id="method-M000025" class="method-detail"> + <a name="M000025"></a> <div class="method-heading"> - <a href="#M000048" class="method-signature"> - <span class="method-name">unfoldr</span><span class="method-args">()</span> + <a href="#M000025" class="method-signature"> + <span class="method-name">transpose</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> +<tr><td valign="top">transpose &#8212; :</td><td>[[a]] -&gt; [[a]] + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000025-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000025-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 105</span> +105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transpose</span>(<span class="ruby-identifier">list</span>) +106: <span class="ruby-comment cmt"># FIXIT</span> +107: <span class="ruby-identifier">lambda</span> { <span class="ruby-identifier">list</span>.<span class="ruby-identifier">transpose</span> } +108: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000055" class="method-detail"> + <a name="M000055"></a> + + <div class="method-heading"> + <a href="#M000055" class="method-signature"> + <span class="method-name">unfoldr</span><span class="method-args">(list)</span> + </a> + </div> + + <div class="method-description"> + <table> <tr><td valign="top">unfoldr &#8212; :</td><td>(b -&gt; Maybe (a, b)) -&gt; b -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000048-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000048-source"> + onclick="toggleCode('M000055-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000055-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 261</span> -261: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unfoldr</span> -262: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unfoldr' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -263: <span class="ruby-keyword kw">return</span> [] -264: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 283</span> +283: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unfoldr</span>(<span class="ruby-identifier">list</span>) +284: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unfoldr' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +285: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +286: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000096" class="method-detail"> - <a name="M000096"></a> + <div id="method-M000105" class="method-detail"> + <a name="M000105"></a> <div class="method-heading"> - <a href="#M000096" class="method-signature"> - <span class="method-name">union</span><span class="method-args">()</span> + <a href="#M000105" class="method-signature"> + <span class="method-name">union</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">union &#8212; :</td><td>(Eq a) =&gt; [a] -&gt; [a] -&gt; [a] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000096-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000096-source"> + onclick="toggleCode('M000105-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000105-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 522</span> -522: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">union</span> -523: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'union' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -524: <span class="ruby-keyword kw">return</span> [] -525: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 561</span> +561: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">union</span>(<span class="ruby-identifier">list</span>) +562: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'union' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +563: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +564: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000092" class="method-detail"> - <a name="M000092"></a> + <div id="method-M000101" class="method-detail"> + <a name="M000101"></a> <div class="method-heading"> - <a href="#M000092" class="method-signature"> - <span class="method-name">unlines</span><span class="method-args">()</span> + <a href="#M000101" class="method-signature"> + <span class="method-name">unlines</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">unlines &#8212; :</td><td>[String] -&gt; String </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000092-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000092-source"> + onclick="toggleCode('M000101-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000101-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 494</span> -494: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unlines</span> -495: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unlines' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -496: <span class="ruby-keyword kw">return</span> [] -497: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 535</span> +535: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unlines</span>(<span class="ruby-identifier">list</span>) +536: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unlines' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +537: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +538: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000093" class="method-detail"> - <a name="M000093"></a> + <div id="method-M000102" class="method-detail"> + <a name="M000102"></a> <div class="method-heading"> - <a href="#M000093" class="method-signature"> - <span class="method-name">unwords</span><span class="method-args">()</span> + <a href="#M000102" class="method-signature"> + <span class="method-name">unwords</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">unwords &#8212; :</td><td>[String] -&gt; String </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000093-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000093-source"> + onclick="toggleCode('M000102-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000102-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 500</span> -500: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unwords</span> -501: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unwords' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -502: <span class="ruby-keyword kw">return</span> [] -503: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 541</span> +541: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unwords</span>(<span class="ruby-identifier">list</span>) +542: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unwords' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +543: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +544: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000087" class="method-detail"> - <a name="M000087"></a> + <div id="method-M000096" class="method-detail"> + <a name="M000096"></a> <div class="method-heading"> - <a href="#M000087" class="method-signature"> - <span class="method-name">unzip</span><span class="method-args">()</span> + <a href="#M000096" class="method-signature"> + <span class="method-name">unzip</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">unzip &#8212; :</td><td>[(a,b)] -&gt; ([a],[b]) </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000087-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000087-source"> + onclick="toggleCode('M000096-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000096-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 459</span> -459: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip</span> -460: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -461: <span class="ruby-keyword kw">return</span> [] -462: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 501</span> +501: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip</span>(<span class="ruby-identifier">list</span>) +502: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +503: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +504: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000088" class="method-detail"> - <a name="M000088"></a> + <div id="method-M000097" class="method-detail"> + <a name="M000097"></a> <div class="method-heading"> - <a href="#M000088" class="method-signature"> - <span class="method-name">unzip3</span><span class="method-args">()</span> + <a href="#M000097" class="method-signature"> + <span class="method-name">unzip3</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <p> unzip3 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000088-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000088-source"> + onclick="toggleCode('M000097-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000097-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 465</span> -465: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip3</span> -466: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -467: <span class="ruby-keyword kw">return</span> [] -468: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 507</span> +507: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip3</span>(<span class="ruby-identifier">list</span>) +508: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +509: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +510: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000089" class="method-detail"> - <a name="M000089"></a> + <div id="method-M000098" class="method-detail"> + <a name="M000098"></a> <div class="method-heading"> - <a href="#M000089" class="method-signature"> - <span class="method-name">unzip4</span><span class="method-args">()</span> + <a href="#M000098" class="method-signature"> + <span class="method-name">unzip4</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <p> unzip4, unzip5, unzip6, unzip7 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000089-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000089-source"> + onclick="toggleCode('M000098-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000098-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 471</span> -471: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip4</span> -472: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -473: <span class="ruby-keyword kw">return</span> [] -474: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 513</span> +513: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unzip4</span>(<span class="ruby-identifier">list</span>) +514: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'unzip4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +515: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +516: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000091" class="method-detail"> - <a name="M000091"></a> + <div id="method-M000100" class="method-detail"> + <a name="M000100"></a> <div class="method-heading"> - <a href="#M000091" class="method-signature"> - <span class="method-name">words</span><span class="method-args">()</span> + <a href="#M000100" class="method-signature"> + <span class="method-name">words</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">words &#8212; :</td><td>String -&gt; [String] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000091-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000091-source"> + onclick="toggleCode('M000100-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000100-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 488</span> -488: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">words</span> -489: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'words' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -490: <span class="ruby-keyword kw">return</span> [] -491: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 529</span> +529: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">words</span>(<span class="ruby-identifier">list</span>) +530: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'words' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +531: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +532: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000079" class="method-detail"> - <a name="M000079"></a> + <div id="method-M000087" class="method-detail"> + <a name="M000087"></a> <div class="method-heading"> - <a href="#M000079" class="method-signature"> - <span class="method-name">zip3</span><span class="method-args">()</span> + <a href="#M000087" class="method-signature"> + <span class="method-name">zip</span><span class="method-args">(list1, list2)</span> </a> </div> <div class="method-description"> + <table> +<tr><td valign="top">zip &#8212; :</td><td>[a] -&gt; [b] -&gt; [(a,b)] + +</td></tr> +</table> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000087-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000087-source"> +<pre> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 459</span> +459: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip</span>(<span class="ruby-identifier">list1</span>, <span class="ruby-identifier">list2</span>) +460: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +461: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +462: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000088" class="method-detail"> + <a name="M000088"></a> + + <div class="method-heading"> + <a href="#M000088" class="method-signature"> + <span class="method-name">zip3</span><span class="method-args">(list)</span> + </a> + </div> + + <div class="method-description"> <p> zip3 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000079-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000079-source"> + onclick="toggleCode('M000088-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000088-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 424</span> -424: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip3</span> -425: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -426: <span class="ruby-keyword kw">return</span> [] -427: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 465</span> +465: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip3</span>(<span class="ruby-identifier">list</span>) +466: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +467: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +468: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000080" class="method-detail"> - <a name="M000080"></a> + <div id="method-M000089" class="method-detail"> + <a name="M000089"></a> <div class="method-heading"> - <a href="#M000080" class="method-signature"> - <span class="method-name">zip4</span><span class="method-args">()</span> + <a href="#M000089" class="method-signature"> + <span class="method-name">zip4</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <p> zip4, zip5, zip6, zip7 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000080-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000080-source"> + onclick="toggleCode('M000089-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000089-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 430</span> -430: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip4</span> -431: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -432: <span class="ruby-keyword kw">return</span> [] -433: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 471</span> +471: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip4</span>(<span class="ruby-identifier">list</span>) +472: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +473: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +474: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000082" class="method-detail"> - <a name="M000082"></a> + <div id="method-M000091" class="method-detail"> + <a name="M000091"></a> <div class="method-heading"> - <span class="method-name">zipWith</span><span class="method-args">()</span> + <span class="method-name">zipWith</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000081">zip_with</a> +Alias for <a href="List.html#M000090">zip_with</a> </p> </div> </div> - <div id="method-M000084" class="method-detail"> - <a name="M000084"></a> + <div id="method-M000093" class="method-detail"> + <a name="M000093"></a> <div class="method-heading"> - <span class="method-name">zipWith3</span><span class="method-args">()</span> + <span class="method-name">zipWith3</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000083">zip_with3</a> +Alias for <a href="List.html#M000092">zip_with3</a> </p> </div> </div> - <div id="method-M000086" class="method-detail"> - <a name="M000086"></a> + <div id="method-M000095" class="method-detail"> + <a name="M000095"></a> <div class="method-heading"> - <span class="method-name">zipWith4</span><span class="method-args">()</span> + <span class="method-name">zipWith4</span><span class="method-args">(list)</span> </div> <div class="method-description"> <p> -Alias for <a href="List.html#M000085">zip_with4</a> +Alias for <a href="List.html#M000094">zip_with4</a> </p> </div> </div> - <div id="method-M000081" class="method-detail"> - <a name="M000081"></a> + <div id="method-M000090" class="method-detail"> + <a name="M000090"></a> <div class="method-heading"> - <a href="#M000081" class="method-signature"> - <span class="method-name">zip_with</span><span class="method-args">()</span> + <a href="#M000090" class="method-signature"> + <span class="method-name">zip_with</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <table> <tr><td valign="top">zipWith &#8212; :</td><td>(a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c] </td></tr> </table> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000081-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000081-source"> + onclick="toggleCode('M000090-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000090-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 437</span> -437: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with</span> -438: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -439: <span class="ruby-keyword kw">return</span> [] -440: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 477</span> +477: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with</span>(<span class="ruby-identifier">list</span>) +478: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +479: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +480: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000083" class="method-detail"> - <a name="M000083"></a> + <div id="method-M000092" class="method-detail"> + <a name="M000092"></a> <div class="method-heading"> - <a href="#M000083" class="method-signature"> - <span class="method-name">zip_with3</span><span class="method-args">()</span> + <a href="#M000092" class="method-signature"> + <span class="method-name">zip_with3</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <p> zipWith3 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000083-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000083-source"> + onclick="toggleCode('M000092-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000092-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 444</span> -444: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with3</span> -445: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -446: <span class="ruby-keyword kw">return</span> [] -447: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 485</span> +485: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with3</span>(<span class="ruby-identifier">list</span>) +486: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with3' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +487: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +488: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000085" class="method-detail"> - <a name="M000085"></a> + <div id="method-M000094" class="method-detail"> + <a name="M000094"></a> <div class="method-heading"> - <a href="#M000085" class="method-signature"> - <span class="method-name">zip_with4</span><span class="method-args">()</span> + <a href="#M000094" class="method-signature"> + <span class="method-name">zip_with4</span><span class="method-args">(list)</span> </a> </div> <div class="method-description"> <p> zipWith4, zipWith5, zipWith6, zipWith7 </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000085-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000085-source"> + onclick="toggleCode('M000094-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000094-source"> <pre> - <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 451</span> -451: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with4</span> -452: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> -453: <span class="ruby-keyword kw">return</span> [] -454: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/prelude/list.rb, line 493</span> +493: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zip_with4</span>(<span class="ruby-identifier">list</span>) +494: <span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Method 'zip_with4' is not implemented yet.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$VERBOSE</span> +495: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lambda</span> { [] } +496: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> \ No newline at end of file