Ticket #1034: listDocs.html

File listDocs.html, 5.6 KB (added by Andriy, 7 years ago)

HTML file showing Haddock results for the affected part of documentation.

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<HTML>
3<HEAD>
4        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
5        <TITLE></TITLE>
6        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
7        <META NAME="AUTHOR" CONTENT="Andriy Palamarchuk">
8        <META NAME="CREATED" CONTENT="20061204;11502200">
9        <META NAME="CHANGEDBY" CONTENT="Andriy Palamarchuk">
10        <META NAME="CHANGED" CONTENT="20061204;11510200">
11</HEAD>
12<BODY LANG="en-US" DIR="LTR">
13<P STYLE="margin-bottom: 0in"><A NAME="10"></A><A NAME="11"></A><A NAME="v:take"></A>
14<B>take</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
15-&gt; [a] -&gt; [a]</P>
16<P><TT><A HREF="../out/html/Data-List.html#v%3Atake">take</A></TT> <TT>n</TT>,
17applied to a list <TT>xs</TT>, returns the prefix of <TT>xs</TT> of
18length <TT>n</TT>, or <TT>xs</TT> itself if <TT>n &gt; <TT><A HREF="../out/html/Data-List.html#v%3Alength">length</A></TT>
19xs</TT>:
20</P>
21<PRE> take 5 &quot;Hello World!&quot; == &quot;Hello&quot;
22 take 3 [1,2,3,4,5] == [1,2,3]
23 take 3 [1,2] == [1,2]
24 take 3 [] == []
25 take (-1) [1,2] == []
26 take 0 [1,2] == []</PRE><P>
27It is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericTake">genericTake</A></TT>,
28in which <TT>n</TT> may be of any integral type.
29</P>
30<P><A NAME="v:drop"></A><B>drop</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
31-&gt; [a] -&gt; [a]</P>
32<P><TT><A HREF="../out/html/Data-List.html#v%3Adrop">drop</A></TT> <TT>n
33xs</TT> returns the suffix of <TT>xs</TT> after the first <TT>n</TT>
34elements, or <TT>[]</TT> if <TT>n &gt; <TT><A HREF="../out/html/Data-List.html#v%3Alength">length</A></TT>
35xs</TT>:
36</P>
37<PRE> drop 6 &quot;Hello World!&quot; == &quot;World!&quot;
38 drop 3 [1,2,3,4,5] == [4,5]
39 drop 3 [1,2] == []
40 drop 3 [] == []
41 drop (-1) [1,2] == [1,2]
42 drop 0 [1,2] == [1,2]</PRE><P>
43It is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericDrop">genericDrop</A></TT>,
44in which <TT>n</TT> may be of any integral type.
45</P>
46<P><A NAME="v:splitAt"></A><B>splitAt</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
47-&gt; [a] -&gt; ([a], [a])</P>
48<P><TT><A HREF="../out/html/Data-List.html#v%3AsplitAt">splitAt</A></TT>
49<TT>n xs</TT> returns a tuple where first element is <TT>xs</TT>
50prefix of length <TT>n</TT> and second element is the remainder of
51the list:
52</P>
53<PRE> splitAt 6 &quot;Hello World!&quot; == (&quot;Hello &quot;,&quot;World!&quot;)
54 splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
55 splitAt 1 [1,2,3] == ([1],[2,3])
56 splitAt 3 [1,2,3] == ([1,2,3],[])
57 splitAt 4 [1,2,3] == ([1,2,3],[])
58 splitAt 0 [1,2,3] == ([],[1,2,3])
59 splitAt (-1) [1,2,3] == ([],[1,2,3])</PRE><P>
60It is equivalent to <TT>(<TT><A HREF="../out/html/Data-List.html#v%3Atake">take</A></TT>
61n xs, <TT><A HREF="../out/html/Data-List.html#v%3Adrop">drop</A></TT>
62n xs)</TT>. <TT><A HREF="../out/html/Data-List.html#v%3AsplitAt">splitAt</A></TT>
63is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericSplitAt">genericSplitAt</A></TT>,
64in which <TT>n</TT> may be of any integral type.
65</P>
66<P><A NAME="v:takeWhile"></A><B>takeWhile</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
67-&gt; [a] -&gt; [a]</P>
68<P><TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>,
69applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns the
70longest prefix (possibly empty) of <TT>xs</TT> of elements that
71satisfy <TT>p</TT>:
72</P>
73<PRE> takeWhile (&lt; 3) [1,2,3,4,1,2,3,4] == [1,2]
74 takeWhile (&lt; 9) [1,2,3] == [1,2,3]
75 takeWhile (&lt; 0) [1,2,3] == []</PRE><P>
76<A NAME="v:dropWhile"></A><B>dropWhile</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
77-&gt; [a] -&gt; [a]</P>
78<P><TT><A HREF="../out/html/Data-List.html#v%3AdropWhile">dropWhile</A></TT>
79<TT>p xs</TT> returns the suffix remaining after <TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>
80<TT>p xs</TT>:
81</P>
82<PRE> dropWhile (&lt; 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
83 dropWhile (&lt; 9) [1,2,3] == []
84 dropWhile (&lt; 0) [1,2,3] == [1,2,3]</PRE><P>
85<A NAME="v:span"></A><B>span</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
86-&gt; [a] -&gt; ([a], [a])</P>
87<P><TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT>,
88applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns a
89tuple where first element is longest prefix (possibly empty) of <TT>xs</TT>
90of elements that satisfy <TT>p</TT> and second element is the
91remainder of the list:
92</P>
93<PRE> span (&lt; 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
94 span (&lt; 10) [1,2,3] == ([1,2,3],[])
95 span (== 10) [1,2,3] == ([],[1,2,3])</PRE><P>
96<TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT> <TT>p
97xs</TT> is equivalent to <TT>(<TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>
98p xs, <TT><A HREF="../out/html/Data-List.html#v%3AdropWhile">dropWhile</A></TT>
99p xs)</TT> 
100</P>
101<P><A NAME="v:break"></A><B>break</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
102-&gt; [a] -&gt; ([a], [a])</P>
103<P><TT><A HREF="../out/html/Data-List.html#v%3Abreak">break</A></TT>,
104applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns a
105tuple where first element is longest prefix (possibly empty) of <TT>xs</TT>
106of elements that <EM>do not satisfy</EM> <TT>p</TT> and second
107element is the remainder of the list:
108</P>
109<PRE> break (&gt; 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
110 break (&lt; 9) [1,2,3] == ([],[1,2,3])
111 break (&gt; 9) [1,2,3] == ([1,2,3],[])</PRE><P>
112<TT><A HREF="../out/html/Data-List.html#v%3Abreak">break</A></TT> <TT>p</TT>
113is equivalent to <TT><TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT>
114(not . p)</TT>.
115</P>
116<P><BR><BR>
117</P>
118</BODY>
119</HTML>