man-pages/man3/Misc.Stdlib.List.3o.html
2021-03-31 01:06:50 +01:00

197 lines
2.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Misc.Stdlib.List</TITLE>
</HEAD><BODY>
<H1>Misc.Stdlib.List</H1>
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Misc.Stdlib.List - no description
<A NAME="lbAC">&nbsp;</A>
<H2>Module</H2>
Module Misc.Stdlib.List
<A NAME="lbAD">&nbsp;</A>
<H2>Documentation</H2>
<P>
Module
<B>List</B>
<BR>&nbsp;:&nbsp;
<B>sig end</B>
<P>
<P>
<P>
<P>
<P>
<P>
<P>
<I>type </I>
<B>'a</B>
<I>t </I>
=
<B>'a list</B>
<P>
<P>
<P>
<P>
<P>
<I>val compare </I>
:
<B>('a -&gt; 'a -&gt; int) -&gt; 'a t -&gt; 'a t -&gt; int</B>
<P>
The lexicographic order supported by the provided order.
There is no constraint on the relative lengths of the lists.
<P>
<P>
<P>
<I>val equal </I>
:
<B>('a -&gt; 'a -&gt; bool) -&gt; 'a t -&gt; 'a t -&gt; bool</B>
<P>
Returns
<B>true</B>
iff the given lists have the same length and content
with respect to the given equality function.
<P>
<P>
<P>
<I>val find_map </I>
:
<B>('a -&gt; 'b option) -&gt; 'a t -&gt; 'b option</B>
<P>
<P>
<B>find_map f l</B>
returns the first evaluation of
<B>f</B>
that returns
<B>Some</B>
,
or returns None if there is no such element.
<P>
<P>
<P>
<I>val some_if_all_elements_are_some </I>
:
<B>'a option t -&gt; 'a t option</B>
<P>
If all elements of the given list are
<B>Some _</B>
then
<B>Some xs</B>
is returned with the
<B>xs</B>
being the contents of those
<B>Some</B>
s, with
order preserved. Otherwise return
<B>None</B>
.
<P>
<P>
<P>
<I>val map2_prefix </I>
:
<B>('a -&gt; 'b -&gt; 'c) -&gt;</B>
<B>'a t -&gt;</B>
<B>'b t -&gt; 'c t * 'b t</B>
<P>
<P>
<B>let r1, r2 = map2_prefix f l1 l2</B>
If
<B>l1</B>
is of length n and
<B>l2 = h2 @ t2</B>
with h2 of length n,
r1 is
<B>List.map2 f l1 h1</B>
and r2 is t2.
<P>
<P>
<P>
<I>val split_at </I>
:
<B>int -&gt; 'a t -&gt; 'a t * 'a t</B>
<P>
<P>
<B>split_at n l</B>
returns the pair
<B>before, after</B>
where
<B>before</B>
is
the
<B>n</B>
first elements of
<B>l</B>
and
<B>after</B>
the remaining ones.
If
<B>l</B>
has less than
<B>n</B>
elements, raises Invalid_argument.
<P>
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">Module</A><DD>
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:48 GMT, March 31, 2021
</BODY>
</HTML>