197 lines
2.6 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Misc.Stdlib.List - no description
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Misc.Stdlib.List
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>List</B>
|
|
|
|
<BR> :
|
|
<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 -> 'a -> int) -> 'a t -> 'a t -> 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 -> 'a -> bool) -> 'a t -> 'a t -> 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 -> 'b option) -> 'a t -> '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 -> '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 -> 'b -> 'c) -></B>
|
|
|
|
<B>'a t -></B>
|
|
|
|
<B>'b t -> '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 -> 'a t -> '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"> </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>
|