<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
        <TITLE></TITLE>
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
        <META NAME="AUTHOR" CONTENT="Andriy Palamarchuk">
        <META NAME="CREATED" CONTENT="20061204;11502200">
        <META NAME="CHANGEDBY" CONTENT="Andriy Palamarchuk">
        <META NAME="CHANGED" CONTENT="20061204;11510200">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P STYLE="margin-bottom: 0in"><A NAME="10"></A><A NAME="11"></A><A NAME="v:take"></A>
<B>take</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
-&gt; [a] -&gt; [a]</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3Atake">take</A></TT> <TT>n</TT>,
applied to a list <TT>xs</TT>, returns the prefix of <TT>xs</TT> of
length <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>
xs</TT>: 
</P>
<PRE> take 5 &quot;Hello World!&quot; == &quot;Hello&quot;
 take 3 [1,2,3,4,5] == [1,2,3]
 take 3 [1,2] == [1,2]
 take 3 [] == []
 take (-1) [1,2] == []
 take 0 [1,2] == []</PRE><P>
It is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericTake">genericTake</A></TT>,
in which <TT>n</TT> may be of any integral type. 
</P>
<P><A NAME="v:drop"></A><B>drop</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
-&gt; [a] -&gt; [a]</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3Adrop">drop</A></TT> <TT>n
xs</TT> returns the suffix of <TT>xs</TT> after the first <TT>n</TT>
elements, or <TT>[]</TT> if <TT>n &gt; <TT><A HREF="../out/html/Data-List.html#v%3Alength">length</A></TT>
xs</TT>: 
</P>
<PRE> drop 6 &quot;Hello World!&quot; == &quot;World!&quot;
 drop 3 [1,2,3,4,5] == [4,5]
 drop 3 [1,2] == []
 drop 3 [] == []
 drop (-1) [1,2] == [1,2]
 drop 0 [1,2] == [1,2]</PRE><P>
It is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericDrop">genericDrop</A></TT>,
in which <TT>n</TT> may be of any integral type. 
</P>
<P><A NAME="v:splitAt"></A><B>splitAt</B> :: <A HREF="../out/html/Prelude.html#t%3AInt">Int</A>
-&gt; [a] -&gt; ([a], [a])</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3AsplitAt">splitAt</A></TT>
<TT>n xs</TT> returns a tuple where first element is <TT>xs</TT>
prefix of length <TT>n</TT> and second element is the remainder of
the list: 
</P>
<PRE> splitAt 6 &quot;Hello World!&quot; == (&quot;Hello &quot;,&quot;World!&quot;)
 splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
 splitAt 1 [1,2,3] == ([1],[2,3])
 splitAt 3 [1,2,3] == ([1,2,3],[])
 splitAt 4 [1,2,3] == ([1,2,3],[])
 splitAt 0 [1,2,3] == ([],[1,2,3])
 splitAt (-1) [1,2,3] == ([],[1,2,3])</PRE><P>
It is equivalent to <TT>(<TT><A HREF="../out/html/Data-List.html#v%3Atake">take</A></TT>
n xs, <TT><A HREF="../out/html/Data-List.html#v%3Adrop">drop</A></TT>
n xs)</TT>. <TT><A HREF="../out/html/Data-List.html#v%3AsplitAt">splitAt</A></TT>
is an instance of the more general <TT><A HREF="../out/html/Data-List.html#v%3AgenericSplitAt">genericSplitAt</A></TT>,
in which <TT>n</TT> may be of any integral type. 
</P>
<P><A NAME="v:takeWhile"></A><B>takeWhile</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
-&gt; [a] -&gt; [a]</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>,
applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns the
longest prefix (possibly empty) of <TT>xs</TT> of elements that
satisfy <TT>p</TT>: 
</P>
<PRE> takeWhile (&lt; 3) [1,2,3,4,1,2,3,4] == [1,2]
 takeWhile (&lt; 9) [1,2,3] == [1,2,3]
 takeWhile (&lt; 0) [1,2,3] == []</PRE><P>
<A NAME="v:dropWhile"></A><B>dropWhile</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
-&gt; [a] -&gt; [a]</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3AdropWhile">dropWhile</A></TT>
<TT>p xs</TT> returns the suffix remaining after <TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>
<TT>p xs</TT>: 
</P>
<PRE> dropWhile (&lt; 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
 dropWhile (&lt; 9) [1,2,3] == []
 dropWhile (&lt; 0) [1,2,3] == [1,2,3]</PRE><P>
<A NAME="v:span"></A><B>span</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
-&gt; [a] -&gt; ([a], [a])</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT>,
applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns a
tuple where first element is longest prefix (possibly empty) of <TT>xs</TT>
of elements that satisfy <TT>p</TT> and second element is the
remainder of the list: 
</P>
<PRE> span (&lt; 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
 span (&lt; 10) [1,2,3] == ([1,2,3],[])
 span (== 10) [1,2,3] == ([],[1,2,3])</PRE><P>
<TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT> <TT>p
xs</TT> is equivalent to <TT>(<TT><A HREF="../out/html/Data-List.html#v%3AtakeWhile">takeWhile</A></TT>
p xs, <TT><A HREF="../out/html/Data-List.html#v%3AdropWhile">dropWhile</A></TT>
p xs)</TT> 
</P>
<P><A NAME="v:break"></A><B>break</B> :: (a -&gt; <A HREF="../out/html/Prelude.html#t%3ABool">Bool</A>)
-&gt; [a] -&gt; ([a], [a])</P>
<P><TT><A HREF="../out/html/Data-List.html#v%3Abreak">break</A></TT>,
applied to a predicate <TT>p</TT> and a list <TT>xs</TT>, returns a
tuple where first element is longest prefix (possibly empty) of <TT>xs</TT>
of elements that <EM>do not satisfy</EM> <TT>p</TT> and second
element is the remainder of the list: 
</P>
<PRE> break (&gt; 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
 break (&lt; 9) [1,2,3] == ([],[1,2,3])
 break (&gt; 9) [1,2,3] == ([1,2,3],[])</PRE><P>
<TT><A HREF="../out/html/Data-List.html#v%3Abreak">break</A></TT> <TT>p</TT>
is equivalent to <TT><TT><A HREF="../out/html/Data-List.html#v%3Aspan">span</A></TT>
(not . p)</TT>. 
</P>
<P><BR><BR>
</P>
</BODY>
</HTML>