Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(redesign) Add missing pieces

  • Loading branch information...
commit a517905e38b242bf7dbc95b4b99181580a6975e5 1 parent 384ee97
@pw374 pw374 authored
View
123 src/site/community/index.md
@@ -0,0 +1,123 @@
+<!-- ((! set title Community !)) ((! set community !)) -->
+
+<div class="container">
+ <h1>Community</h1>
+ <div class="row">
+ <div class="span2">
+ <img src="/img/community-large.png" alt="Community">
+ </div>
+ <section id="community-leader" class="span6">
+ <p>OCaml has a diverse, worldwide community and one of the main benefits is the ability to easily reach each other. Mailing lists are the most common way people interact although you will always find users on IRC and around the web.</p>
+ </section>
+ <div class="span4">
+ <img src="/img/ocaml-large.png" alt="OCaml">
+ <p><a href="/docs/logos">More logos</a></p>
+ </div>
+ </div>
+ <div class="row">
+ <section class="span12 condensed">
+ <h1 class="ruled">Mailing Lists</h1>
+ <div class="row">
+ <section class="span4 condensed">
+ <p><strong><a href="https://sympa.inria.fr/sympa/arc/caml-list">caml-list@inria.fr</a></strong><br />
+ <strong><em>Main OCaml List</em></strong><br />
+ Intended for all users of OCaml. The purpose of this list is to share experience, exchange ideas and code, and discuss applications of the language.</p>
+ <p><strong><a href="http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-announce">caml-announce@inria.fr</a></strong><br />
+ <strong><em>Low volume annoncements</em></strong><br />
+ This is a low-traffic, moderated list for announcements of OCaml releases and new OCaml-related software, libraries, documents, etc.</p>
+ </section>
+ <section class="span4 condensed">
+ <p><strong><a href="http://groups.yahoo.com/neo/groups/ocaml_beginners/info">ocaml_beginners@yahoogroups.com</a></strong><br />
+ <strong><em>Beginners' List</em></strong><br />
+ Everything you wanted to ask about OCaml, but were afraid to submit in the main list can be asked, answered and discussed here.</p>
+ <p><strong><a href="http://lists.ocaml.org">lists.ocaml.org</a></strong><br />
+ <strong><em>Community lists and working groups</em></strong><br />
+ User-interest lists and working groups convened with specific goals.</p>
+ <p><small><em><a href="/community/mailing_lists">Browse all the lists</a>.</em></small></p>
+ </section>
+ <section class="span4 condensed">
+ <h4>Recent email threads</h4>
+ <ul class="news-feed">
+((! input tpl/last_ml_topics.mpp !))
+ </ul>
+ <footer>
+ <p><a href="https://sympa.inria.fr/sympa/arc/caml-list/">See archives</a></p>
+ </footer>
+ </section>
+
+ </div>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span4 condensed">
+ <h1 class="ruled">Support</h1>
+ <p>A great way to get free support is by using the active <a href="/community/mailing_lists">mailing lists</a>. When you need to go beyond this and get professional support, you have a number of options available.</p>
+ <p>If you would like to give support to OCaml, you can join the Consortium or support the work of OCaml Labs. <a href="/community/support">Find out more</a>.</p>
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">Upcoming Events</h1>
+ <ul class="news-feed">
+ <li class="announcement">
+ <article>
+ <h1><a href="#">OCaml 2013</a></h1>
+ <p>24 September 2013</p>
+ <a href="/meetings/ocaml/2013/">
+ <img src="/img/announcement.png" alt="Announcement">
+ </a>
+ </article>
+ <li>
+ <article>
+ <h1><a href="#">Cambridge NonDysFunctional Programmers</a></h1>
+ <p>18 September 2013</p>
+ <a href="http://www.meetup.com/Cambridge-NonDysFunctional-Programmers/events/138406202/">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ <li>
+ <article>
+ <h1><a href="http://www.meetup.com/ocaml-paris/events/128514752/">OCaml Users in Paris</a></h1>
+ <p>XX October 2013</p>
+ <a href="#">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ <li>
+ <article>
+ <h1><a href="#">Consortium Meeting</a></h1>
+ <p>XX November 2013</p>
+ <a href="/meetings/consortium">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ </ul>
+ <footer>
+ <p><a href="/meetings">See full calendar</a></p>
+ </footer>
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">News</h1>
+ ((! input tpl/front_news.mpp !))
+ <footer>
+ <p><a href="#">See full list</a></p>
+ </footer>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span12 condensed">
+ <h1 class="ruled">OCaml around the web</h1>
+ <p>[Insert logos here]</p>
+ <p><a href=""></a></p>
+ <p><a href=""></a></p>
+ <p><a href=""></a></p>
+ <p><a href=""></a></p>
+ <p><a href=""></a></p>
+ <p><a href=""></a></p>
+
+ </section>
+
+ </div>
+</div>
+
View
2  src/site/docs/consortium-license.fr.md
View
85 src/site/docs/index.md
@@ -0,0 +1,85 @@
+<!-- ((! set title Docs !)) ((! set documentation !)) -->
+
+<div class="container">
+ <h1>Documentation</h1>
+ <div class="row">
+ <section class="span6 condensed">
+ <h1 class="ruled">Summary</h1>
+ <p>Here you'll find links to documentation for the OCaml compiler, <a href="/releases">release</a> information and other resources.</p>
+ <p>Documentation for a given package can be found by following the link on that package's information page. <a href="/pkg/">Search the package list</a> to find what you need.</p>
+ </section>
+ <section class="span6 condensed">
+ <h1 class="ruled">Reference</h1>
+ <div class="row">
+ <a href="#" class="span3 documentation-highlight">
+ <img src="/img/manual.png" alt="">
+ OCaml Manual
+ </a>
+ <a href="license.html" class="span3 documentation-highlight">
+ <img src="/img/license.png" alt="">
+ OCaml License
+ </a>
+ </div>
+ <div class="row">
+ <a href="/pkg" class="span3 documentation-highlight">
+ <img src="/img/documents.png" alt="">
+ Package Documents
+ </a>
+ <a href="cheat_sheets.html" class="span3 documentation-highlight">
+ <img src="/img/cheat.png" alt="">
+ Cheat Sheets
+ </a>
+ </div>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span6 condensed">
+ <h1 class="ruled">OPAM Docs</h1>
+ <p>The OCaml Package Manager (OPAM) is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow. For documentation on installing OPAM or packaging your libraries, <a href="http://opam.ocamlpro.org/doc/Quick_Install.html">read here</a>. Packages are <a href="/docs/ocamlot">automatically tested</a> upon submission and reports sent back to maintainers. If you submit a package, you will be rewarded with regular regression tests across many diverse operating systems and platforms.</p>
+ <p>OPAM has been created and is maintained by OCamlPro and OCaml Labs. Bug reports and feature requests for the tool should be reported on <a href="https://github.com/OCamlPro/opam/issues">OPAM's issue-tracker</a>. Packaging issues or requests for a new package can be reported on the <a href="https://github.com/OCamlPro/opam-repository/issues">main repository's issue-tracker</a>. General queries for both the tool and the packages can be addressed on the <a href="http://lists.ocaml.org/listinfo/platform">OCaml-platform mailing-list</a> and insights and evolution of OPAM internals can discussed on the <a href="http://lists.ocaml.org/listinfo/opam-devel">OPAM-devel mailing-list</a>.</p>
+ </section>
+ <section class="span6 condensed">
+ <h1 class="ruled">OCaml Book</h1>
+ <div class="row">
+ <div class="span2 documentation-book">
+ <a href="https://realworldocaml.org">
+ <img src="/img/real-world-ocaml.png" alt="Real Worl OCaml book">
+ </a>
+ </div>
+ <div class="span4">
+ <p>This hands-on book shows you how to take advantage of OCaml’s functional, imperative and object-oriented programming styles with recipes for many real-world tasks.</p>
+ <p>Starting with OCaml basics, including interactive examples, you’ll move toward more advanced topics such as the module system, foreign-function interface and build system.</p>
+ <p><a href="https://realworldocaml.org">Read Free Online</a></p>
+ </div>
+ </div>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span12 condensed">
+ <h1 class="ruled">Videos</h1>
+ <div class="row">
+ <div class="span4">
+ <p class="documentation-video">
+ <iframe src="//player.vimeo.com/video/14313378?portrait=0&amp;color=ff9933" width="370" height="208" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+ </p>
+ <p>A guest lecture given by Yaron Minsky of Jane Street about how to program effectively in ML. The talk was given as part of the intro computer science class at Harvard, CS51, where the students had spent much of the semester programming in OCaml.</p>
+ </div>
+ <div class="span4">
+ <p class="documentation-video">
+ <iframe src="//player.vimeo.com/video/14317442?portrait=0&amp;color=ff9933" width="370" height="278" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+ </p>
+ <p>Talk at CMU describing the experiences that Jane Street has had using OCaml as it's primary development language.</p>
+ </div>
+ <div class="span4">
+ <p class="documentation-video">
+ <iframe src="//player.vimeo.com/video/6652523?portrait=0&amp;color=ff9933" width="370" height="278" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+ </p>
+ <p>Experience Report: OCaml for an Industrial-strength Static Analysis Framework
+ Pascal Cuoq and Julien Signoles; CEA LIST
+ International Conference on Functional Programming (ICFP) Edinburgh 2009.</p>
+ </div>
+ </div>
+ </section>
+ </div>
+</div>
+
View
5 src/site/docs/opam/index.md
@@ -0,0 +1,5 @@
+# This page has moved
+
+instead of <http://ocaml-redesign.github.io/docs/opam/>
+it's now <http://ocaml-redesign.github.io/pkg/docs/>
+
View
231 src/site/learn/100-lines.html
@@ -0,0 +1,231 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
+ <title>100 lines of OCaml &ndash; OCaml</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Google Web Fonts -->
+ <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet">
+ <link href="http://fonts.googleapis.com/css?family=Domine:400,700" rel="stylesheet">
+
+ <!-- Only part of Bootstrap that we don't load from a CDN is our own customized CSS build. -->
+ <link href="/css/bootstrap.css" rel="stylesheet" media="screen">
+
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
+ <![endif]-->
+
+ </head>
+ <body>
+
+ <nav class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="brand" href="#"><img src="/img/ocaml.png" alt="OCaml"></a>
+ <div class="nav-collapse collapse">
+ ((! input tpl/navbar.mpp !))
+ <form class="navbar-search pull-right">
+ <input class="search-query" type="text" placeholder="Search">
+ </form>
+ </div>
+ </div>
+ </div>
+ </nav>
+
+ <div class="container">
+ <div class="row">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="span4">
+ <nav id="nav-secondary">
+ <ul class="nav nav-list">
+ <li class="nav-header"><a href="#">What is OCaml?</a></li>
+
+
+ <li><a href="#">Strengths</a></li>
+
+
+
+ <li><a href="#">A widely-used programming language</a></li>
+
+
+
+ <li class="dropdown">
+ <a class="dropdown-toggle" href="#" data-target="#" data-toggle="dropdown">Overview of OCaml lanuage and tools</a>
+ <ul class="dropdown-menu">
+
+ <li><a href="#">Safety</a></li>
+
+ <li><a href="#">Functions</a></li>
+
+ <li><a href="#">Imperative features</a></li>
+
+ <li><a href="#">Error recovery</a></li>
+
+ <li><a href="#">Data types</a></li>
+
+ <li><a href="#">Aptness to symbolic computation</a></li>
+
+ <li><a href="#">Polymorphism</a></li>
+
+ <li><a href="#">Programming in the large</a></li>
+
+ <li><a href="#">Object-oriented programming</a></li>
+
+ <li><a href="#">Automatic memory management and garbage collection</a></li>
+
+ <li><a href="#">Evaluation regime</a></li>
+
+ <li><a href="#">Efficient compiler, efficient compiled code</a></li>
+
+ <li><a href="#">Interactivity</a></li>
+
+ <li><a href="#">Debugging facilities</a></li>
+
+ <li><a href="#">Parsing</a></li>
+
+ <li><a href="#">Portability</a></li>
+
+ </ul>
+ </li>
+
+
+ </ul>
+ </nav>
+ </div>
+
+
+ <div id="content-primary" class="span8">
+
+ <ul class="breadcrumb hidden-phone">
+ <li><a href="#">Home</a> <span class="divider"></span></li>
+ <li><a href="#">Learn</a> <span class="divider"></span></li>
+ <li class="active">100 lines</li>
+ </ul>
+
+ <div class="content">
+ <h1>100 lines of OCaml</h1>
+ <p>OCaml possesses an <a href='#'>interactive systems</a> called “toploop”, that lets you type OCaml code and have it evaluated immediately. It is a great way to learn the language and to quickly experiment with ideas. Below, we demonstrate the use of the top loop to illustrate basic capabilities of the language.</p>
+
+<h2 id='elementary_functions'>Elementary functions</h2>
+<dl class='row'>
+ <dt class='span4'>
+
+<div class='highlight'><pre><code class='ocaml'><span class='o'>#</span> <span class='k'>let</span> <span class='n'>square</span> <span class='n'>x</span> <span class='o'>=</span> <span class='n'>x</span> <span class='o'>*</span> <span class='n'>x</span><span class='o'>;;</span>
+<span class='k'>val</span> <span class='n'>square</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='o'>-&gt;</span> <span class='kt'>int</span> <span class='o'>=</span> <span class='o'>&lt;</span><span class='k'>fun</span><span class='o'>&gt;</span>
+<span class='o'>#</span> <span class='n'>square</span> <span class='mi'>3</span><span class='o'>;;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='o'>=</span> <span class='mi'>9</span>
+<span class='o'>#</span> <span class='k'>let</span> <span class='k'>rec</span> <span class='n'>fact</span> <span class='n'>x</span> <span class='o'>=</span>
+ <span class='k'>if</span> <span class='n'>x</span> <span class='o'>&lt;=</span> <span class='mi'>1</span> <span class='k'>then</span> <span class='mi'>1</span> <span class='k'>else</span> <span class='n'>x</span> <span class='o'>*</span> <span class='n'>fact</span> <span class='o'>(</span><span class='n'>x</span> <span class='o'>-</span> <span class='mi'>1</span><span class='o'>);;</span>
+<span class='k'>val</span> <span class='n'>fact</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='o'>-&gt;</span> <span class='kt'>int</span> <span class='o'>=</span> <span class='o'>&lt;</span><span class='k'>fun</span><span class='o'>&gt;</span>
+<span class='o'>#</span> <span class='n'>fact</span> <span class='mi'>5</span><span class='o'>;;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='o'>=</span> <span class='mi'>120</span>
+<span class='o'>#</span> <span class='n'>square</span> <span class='mi'>120</span><span class='o'>;;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='o'>=</span> <span class='mi'>14400</span>
+</code></pre></div>
+
+ </dt>
+ <dd class='span4'>
+ Let us define the square function and the recursive factorial function. Then, let us apply these functions to sample values. Note that, contrarily to popular languages, OCaml uses parentheses for grouping but not for the arguments of a function.
+ </dd>
+</dl>
+<h2 id='automatic_memory_management'>Automatic memory management</h2>
+<dl class='row'>
+ <dt class='span4'>
+
+<div class='highlight'><pre><code class='ocaml'><span class='o'>#</span> <span class='k'>let</span> <span class='n'>l</span> <span class='o'>=</span> <span class='mi'>1</span> <span class='o'>::</span> <span class='mi'>2</span> <span class='o'>::</span> <span class='mi'>3</span> <span class='o'>::</span> <span class='bp'>[]</span><span class='o'>;;</span>
+<span class='k'>val</span> <span class='n'>l</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>[</span><span class='mi'>1</span><span class='o'>;</span> <span class='mi'>2</span><span class='o'>;</span> <span class='mi'>3</span><span class='o'>]</span>
+<span class='o'>#</span> <span class='o'>[</span><span class='mi'>1</span><span class='o'>;</span> <span class='mi'>2</span><span class='o'>;</span> <span class='mi'>3</span><span class='o'>];;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>[</span><span class='mi'>1</span><span class='o'>;</span> <span class='mi'>2</span><span class='o'>;</span> <span class='mi'>3</span><span class='o'>]</span>
+<span class='o'>#</span> <span class='mi'>5</span> <span class='o'>::</span> <span class='n'>l</span><span class='o'>;;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>[</span><span class='mi'>5</span><span class='o'>;</span> <span class='mi'>1</span><span class='o'>;</span> <span class='mi'>2</span><span class='o'>;</span> <span class='mi'>3</span><span class='o'>]</span>
+</code></pre></div>
+
+ </dt>
+ <dd class='span4'>
+ All allocation and deallocation operations are fully automatic. For example, let us consider simply linked lists. Lists are predefined in OCaml. The empty list is written <code>[]</code>. The constructor that allows prepending an element to a list is written <code>::</code> (in infix form).
+ </dd>
+</dl>
+<h2 id='polymorphism_sorting_lists'>Polymorphism: sorting lists</h2>
+<dl class='row'>
+ <dt class='span4'>
+
+<div class='highlight'><pre><code class='ocaml'><span class='o'>#</span> <span class='k'>let</span> <span class='k'>rec</span> <span class='n'>sort</span> <span class='o'>=</span> <span class='k'>function</span>
+ <span class='o'>|</span> <span class='bp'>[]</span> <span class='o'>-&gt;</span> <span class='bp'>[]</span>
+ <span class='o'>|</span> <span class='n'>x</span> <span class='o'>::</span> <span class='n'>l</span> <span class='o'>-&gt;</span> <span class='n'>insert</span> <span class='n'>x</span> <span class='o'>(</span><span class='n'>sort</span> <span class='n'>l</span><span class='o'>)</span>
+<span class='ow'>and</span> <span class='n'>insert</span> <span class='n'>elem</span> <span class='o'>=</span> <span class='k'>function</span>
+ <span class='o'>|</span> <span class='bp'>[]</span> <span class='o'>-&gt;</span> <span class='o'>[</span><span class='n'>elem</span><span class='o'>]</span>
+ <span class='o'>|</span> <span class='n'>x</span> <span class='o'>::</span> <span class='n'>l</span> <span class='o'>-&gt;</span> <span class='k'>if</span> <span class='n'>elem</span> <span class='o'>&lt;</span> <span class='n'>x</span> <span class='k'>then</span> <span class='n'>elem</span> <span class='o'>::</span> <span class='n'>x</span> <span class='o'>::</span> <span class='n'>l</span>
+ <span class='k'>else</span> <span class='n'>x</span> <span class='o'>::</span> <span class='n'>insert</span> <span class='n'>elem</span> <span class='n'>l</span><span class='o'>;;</span>
+<span class='k'>val</span> <span class='n'>sort</span> <span class='o'>:</span> <span class='k'>&#39;</span><span class='n'>a</span> <span class='kt'>list</span> <span class='o'>-&gt;</span> <span class='k'>&#39;</span><span class='n'>a</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>&lt;</span><span class='k'>fun</span><span class='o'>&gt;</span>
+<span class='k'>val</span> <span class='n'>insert</span> <span class='o'>:</span> <span class='k'>&#39;</span><span class='n'>a</span> <span class='o'>-&gt;</span> <span class='k'>&#39;</span><span class='n'>a</span> <span class='kt'>list</span> <span class='o'>-&gt;</span> <span class='k'>&#39;</span><span class='n'>a</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>&lt;</span><span class='k'>fun</span><span class='o'>&gt;</span>
+</code></pre></div>
+
+ </dt>
+ <dd class='span4'>
+ Insertion sort is defined using two recursive functions.
+ </dd>
+</dl><dl class='row'>
+ <dt class='span4'>
+
+<div class='highlight'><pre><code class='ocaml'><span class='o'>#</span> <span class='n'>sort</span> <span class='o'>[</span><span class='mi'>2</span><span class='o'>;</span> <span class='mi'>1</span><span class='o'>;</span> <span class='mi'>0</span><span class='o'>];;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>int</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>[</span><span class='mi'>0</span><span class='o'>;</span> <span class='mi'>1</span><span class='o'>;</span> <span class='mi'>2</span><span class='o'>]</span>
+<span class='o'>#</span> <span class='n'>sort</span> <span class='o'>[</span><span class='s2'>&quot;yes&quot;</span><span class='o'>;</span> <span class='s2'>&quot;ok&quot;</span><span class='o'>;</span> <span class='s2'>&quot;sure&quot;</span><span class='o'>;</span> <span class='s2'>&quot;ya&quot;</span><span class='o'>;</span> <span class='s2'>&quot;yep&quot;</span><span class='o'>];;</span>
+<span class='o'>-</span> <span class='o'>:</span> <span class='kt'>string</span> <span class='kt'>list</span> <span class='o'>=</span> <span class='o'>[</span><span class='s2'>&quot;ok&quot;</span><span class='o'>;</span> <span class='s2'>&quot;sure&quot;</span><span class='o'>;</span> <span class='s2'>&quot;ya&quot;</span><span class='o'>;</span> <span class='s2'>&quot;yep&quot;</span><span class='o'>;</span> <span class='s2'>&quot;yes&quot;</span><span class='o'>]</span>
+</code></pre></div>
+
+ </dt>
+ <dd class='span4'>
+ Note that the type of the list elements remains unspecified: it is represented by a type <em>variable</em> <code>'a</code>. Thus <code>sort</code> can be applied both to a list of integers and to a list of strings.
+ </dd>
+</dl>
+ </div>
+
+ </div>
+
+ </div>
+</div>
+
+ <footer id="footer" class="navbar navbar-inverse navbar-fixed-bottom">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <ul class="nav pull-right">
+ <li><a href="#">Feedback</a></li>
+ <li><a href="#">Contact us</a></li>
+ <li><a href="#">Find us on GitHub</a></li>
+ </ul>
+ </div>
+ </div>
+ </footer>
+
+ <!-- Load javascript from CDN -->
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
+
+ </body>
+</html>
View
75 src/site/learn/index.md
@@ -0,0 +1,75 @@
+<!-- ((! set title Learn !)) ((! set learn !)) -->
+
+<div class="container">
+ <h1>Learn</h1>
+ <div class="row">
+ <div id="platform-logo" class="span2">
+ <img src="/img/ocaml-large.png" alt="OCaml">
+ </div>
+ <section id="learn-leader" class="span7">
+ <h1>What is OCaml?</h1>
+ <p>OCaml is a general purpose industrial-strength programming language with an emphasis on expressiveness and safety. <a href="/learn/companies">Used</a> in environments where a single mistake can cost millions and speed matters, it is supported by an <a href="/community">active community</a> that has developed a <a href="/packages">rich set of libraries</a>. <small><em><a href="/learn/description">Read more</a></em></small>.</p>
+ </section>
+ <div id="platform-download" class="span3">
+ <p><a href="#" class="btn">Install on Mac OSX</a></p>
+ <p>
+ <a href="#">Other systems</a> |
+ <a href="#">What's new?</a>
+ </p>
+ </div>
+ </div>
+ <div class="row">
+ <section class="span4 condensed">
+ <h1 class="ruled">Code examples</h1>
+ ((! cat tpl/tryocaml.html !))
+ ((! input tpl/front_code_snippet.html !))
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">Tutorials</h1>
+ <ul>
+ <li><a href="/learn/tutorials/basics">Basics</a></li>
+ <li><a href="/learn/tutorials/structure_of_ocaml_programs">Structure of OCaml Programs</a></li>
+ <li><a href="/learn/tutorials/map">Maps (Dictionaries)</a></li>
+ <li><a href="/learn/tutorials/set">Sets</a></li>
+ <li><a href="/learn/tutorials/hashtbl">Hash Tables</a></li>
+ <li><a href="/learn/tutorials/comparison_of_standard_containers">Comparison of Standard Containers</a></li>
+ <li><a href="/learn/tutorials/data_types_and_matching">Data Types and Matching</a></li>
+ </ul>
+ <footer>
+ <p><a href="/learn/tutorials">See full list</a></p>
+ </footer>
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">Books</h1>
+ <a href="https://realworldocaml.org"><img style="float: left; margin-right: 10px; margin-bottom: 10px" src="/img/real-world-ocaml.png" alt="Real World OCaml book"></a><p>This hands-on book shows you how to take advantage of OCaml’s functional, imperative and object-oriented programming styles with recipes for many real-world tasks.</p>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span4 condensed">
+ <h1 class="ruled">Common Questions</h1>
+ <ul>
+ <li><a href="/learn/faq">General Questions</a></li>
+ <li><a href="/learn/faq">Core Language</a></li>
+ <li><a href="/learn/faq">Module Language</a></li>
+ <li><a href="/learn/faq">Development Tools</a></li>
+ </ul>
+ <footer>
+ <p><a href="/learn/faq">See full list</a></p>
+ </footer>
+ </section>
+ <section class="span8 condensed">
+ <h1 class="ruled">Industrial Users</h1>
+ <div class="row">
+ <section class="span4 condensed">
+ <p><a href=""><img style="float: left; margin-right: 10px; margin-bottom: 10px" src="/img/jane-street.jpg"></a>Jane Street is a quantitative proprietary trading firm with a unique focus on technology and collaborative problem solving. Almost all of our systems are written in OCaml: from statistical research code operating over terabytes of data to systems-administration tools to our real-time trading infrastructure. On our busiest days, we trade over 200 million equity shares in the US alone.</p>
+
+ <p><a href="https://www.facebook.com"><img style="float: left; margin-right: 10px; margin-bottom: 10px" src="https://www.facebookbrand.com/img/assets/asset.f.logo.lg.png"></a>To handle their huge PHP codebase, Facebook developed <a href="https://github.com/facebook/pfff/wiki/Main">pfff</a>, a set of tools and APIs to perform static analysis, dynamic analysis, code visualizations, code navigations, and style-preserving source-to-source transformations such as refactorings on source code.</p>
+ </section>
+ <section class="span4 condensed">
+ <p><a href="http://caml.inria.fr/about/successes-images/unison.jpg"><img style="float: left; margin-right: 10px; margin-bottom: 10px" src="http://caml.inria.fr/about/successes-images/unison-thumb.jpg" alt="Screenshot" title="Screenshot of Unison's main window"></a></p>
+ </section>
+ </div>
+ </section>
+ </div>
+</div>
+
View
55 src/site/learn/industrial.md
@@ -0,0 +1,55 @@
+<!-- ((! set title Industrial users !)) ((! set learn !)) -->
+
+<blockquote>
+<p>“OCaml helps us to quickly adapt to changing market conditions, and a go from prototypes to production systems with less effort... Billions of dollars of transactions flow through our systems every day, so getting it right matters.”
+</p>
+<small>Jane Street Capital</small>
+<blockquote>
+
+<dl class="row">
+ <dt class="span3">
+ <img src="/img/users/monoidics.png" alt="Monoidic">
+ </dt>
+ <dd class="span5">
+ <h2><a href="#">Monoidics</a>, United Kingdom</h2>
+ <p>Monoidics develops Infer, a static analyzer for software verification. The analysis engine is entirely written in OCaml.</p>
+ </dd>
+</dl>
+<dl class="row">
+ <dt class="span3">
+ <img src="/img/users/acunu.png" alt="Acunu">
+ </dt>
+ <dd class="span5">
+ <h2><a href="#">Acunu</a>, United Kingdom</h2>
+ <p>Acunu is writing, from the ground-up, a Storage and Analytics Platform for Massive Data.</p>
+ </dd>
+</dl>
+<dl class="row">
+ <dt class="span3">
+ <img src="/img/users/ashima.png" alt="Ashima Group">
+ </dt>
+ <dd class="span5">
+ <h2><a href="#">Ashima Group</a>, United States</h2>
+ <p>Ashima Group uses OCaml for geometric reasoning, GPU shader translation, and high-performance servers. OCaml's type system, compiler, tools, community, and design philosophy make it an extremely powerful and versatile tool for diverse systems development tasks.</p>
+ </dd>
+</dl>
+<dl class="row">
+ <dt class="span3">
+ <img src="/img/users/cea.png" alt="CEA">
+ </dt>
+ <dd class="span5">
+ <h2><a href="#">CEA</a>, France</h2>
+ <p>CEA is a French state company, member of the OCaml Consortium. It uses OCaml mainly to develop a platform dedicated to source-code analysis of C software, called <a href="#">Frama-C</a>.</p>
+ </dd>
+</dl>
+<dl class="row">
+ <dt class="span3">
+ <img src="/img/users/citrix.png" alt="Citrix">
+ </dt>
+ <dd class="span5">
+ <h2><a href="#">Citrix</a>, United Kingdom</h2>
+ <p>Citrix uses OCaml in XenServer, a world-class server virtualization system. We also offer a full open-source variant of XenServer called the Xen Cloud Platform, or XCP. Follow along with our OCaml development at <a href="#">github.com/xen-org</a>.</p>
+ </dd>
+</dl>
+
+
View
137 src/site/packages/core.html
@@ -0,0 +1,137 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
+ <title>Core &ndash; OCaml</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Google Web Fonts -->
+ <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet">
+ <link href="http://fonts.googleapis.com/css?family=Domine:400,700" rel="stylesheet">
+
+ <!-- Only part of Bootstrap that we don't load from a CDN is our own customized CSS build. -->
+ <link href="/css/bootstrap.css" rel="stylesheet" media="screen">
+
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
+ <![endif]-->
+
+ </head>
+ <body>
+
+ <nav class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="brand" href="#"><img src="/img/ocaml.png" alt="OCaml"></a>
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+
+ <li><a href="#">Learn</a></li>
+
+ <li class="active"><a href="#">Documentation</a></li>
+
+ <li><a href="#">Platform</a></li>
+
+ <li><a href="#">Packages</a></li>
+
+ <li><a href="#">Community</a></li>
+
+ </ul>
+ <form class="navbar-search pull-right">
+ <input class="search-query" type="text" placeholder="Search">
+ </form>
+ </div>
+ </div>
+ </div>
+ </nav>
+
+ <div class="container">
+ <div class="row">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div id="content-primary" class="span8 offset2">
+
+ <ul class="breadcrumb hidden-phone">
+ <li><a href="#">Home</a> <span class="divider"></span></li>
+ <li><a href="#">Documentation</a> <span class="divider"></span></li>
+ <li class="active">Core</li>
+ </ul>
+
+ <div class="content">
+ <h1>Core</h1>
+ <div id='package-tools'>
+ <p>
+ <label for='version-select'>version:</label>
+ <select id='version-select'>
+ <option>109.10.00</option>
+ <option>109.09.00</option>
+ <option>109.08.00</option>
+ </select>
+ </p>
+ <p>
+ <a href='#'>go to package</a>
+ </p>
+</div><ul class='nav nav-pills'>
+ <li class='active'><a href='#'>Summary</a></li>
+ <li><a href='#'>Tutorials</a></li>
+ <li><a href='#'>Modules</a></li>
+ <li><a href='#'>Types</a></li>
+ <li><a href='#'>Values</a></li>
+</ul>
+<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
+
+<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
+
+<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
+
+<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
+ </div>
+
+ </div>
+
+ </div>
+</div>
+
+ <footer id="footer" class="navbar navbar-inverse navbar-fixed-bottom">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <ul class="nav pull-right">
+ <li><a href="#">Feedback</a></li>
+ <li><a href="#">Contact us</a></li>
+ <li><a href="#">Find us on GitHub</a></li>
+ </ul>
+ </div>
+ </div>
+ </footer>
+
+ <!-- Load javascript from CDN -->
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
+
+ </body>
+</html>
View
346 src/site/packages/core_list-doc.html
@@ -0,0 +1,346 @@
+<div class="ocaml_toplevel_module"><div class="info">Tail recursive version of standard List functions, plus additional operations.</div>
+<pre><span class="TYPEt"><span class="keyword">type</span> <code class="type">'a </code>t</span> = <code class="type">'a list</code></pre>
+<div class="ocaml_include ident" path="?package=core_kernel&amp;module=Container.S1" items="[]"><pre><span class="keyword">include</span> <code class="type"><code class="code"><a href="?package=core_kernel&amp;module=Container.S1">Container.S1</a></code> with type t := 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre></div>
+<div class="ocaml_include ident" path="?package=core_kernel&amp;module=Monad.S" items="[&quot;Monad_infix&quot;]"><pre><span class="keyword">include</span> <code class="type"><code class="code"><a href="?package=core_kernel&amp;module=Monad.S">Monad.S</a></code> with type t := 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre></div>
+<pre><span class="VALof_list"><span class="keyword">val</span> of_list</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">of_list</code> is the identity function. It is useful so that the <code class="code">List</code> module matches
+ the same signature that other container modules do, namely:<br/> <pre class="codepre"><code class="code">
+ val of_list : 'a List.t -&gt; 'a t
+ </code></pre></div></div>
+<pre><span class="VALnth"><span class="keyword">val</span> nth</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; 'a option</code></pre>
+<pre><span class="VALnth_exn"><span class="keyword">val</span> nth_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; 'a</code></pre><div class="info"><div class="info">Return the <code class="code">n</code>-th element of the given list.
+ The first element (head of the list) is at position 0.
+ Raise <code class="code">Failure &quot;nth&quot;</code> if the list is too short.
+ Raise <code class="code">Invalid_argument &quot;List.nth&quot;</code> if <code class="code">n</code> is negative.</div></div>
+<pre><span class="VALrev"><span class="keyword">val</span> rev</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">List reversal.</div></div>
+<pre><span class="VALrev_append"><span class="keyword">val</span> rev_append</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">List.rev_append l1 l2</code> reverses <code class="code">l1</code> and concatenates it to <code class="code">l2</code>. This is equivalent
+ to <code class="code">(</code>TODO reference : List.rev<code class="code"> l1) @ l2</code>, but <code class="code">rev_append</code> is more efficient.</div></div>
+<pre><span class="VALunordered_append"><span class="keyword">val</span> unordered_append</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALrev_map"><span class="keyword">val</span> rev_map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">List.rev_map f l</code> gives the same result as
+ TODO reference : List.rev<code class="code"> (</code>TODO reference : ListLabels.map<code class="code"> f l)</code>, but is more efficient.</div></div>
+<pre><span class="VALfold_left"><span class="keyword">val</span> fold_left</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; init:'b -&gt; f:('b -&gt; 'a -&gt; 'b) -&gt; 'b</code></pre>
+<pre><span class="VALiter2_exn"><span class="keyword">val</span> iter2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; unit) -&gt; unit</code></pre><div class="info"><div class="info"><code class="code">List.iter2_exn f [a1; ...; an] [b1; ...; bn]</code> calls in turn
+ <code class="code">f a1 b1; ...; f an bn</code>.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<pre><span class="VALrev_map2_exn"><span class="keyword">val</span> rev_map2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; 'c) -&gt; 'c <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">List.rev_map2_exn f l1 l2</code> gives the same result as
+ TODO reference : List.rev<code class="code"> (</code>TODO reference : List.map2_exn<code class="code"> f l1 l2)</code>, but is more efficient.</div></div>
+<pre><span class="VALfold2_exn"><span class="keyword">val</span> fold2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; init:'c -&gt; f:('c -&gt; 'a -&gt; 'b -&gt; 'c) -&gt; 'c</code></pre><div class="info"><div class="info"><code class="code">List.fold2_exn f a [b1; ...; bn] [c1; ...; cn]</code> is
+ <code class="code">f (... (f (f a b1 c1) b2 c2) ...) bn cn</code>.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<pre><span class="VALfor_all2_exn"><span class="keyword">val</span> for_all2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; bool) -&gt; bool</code></pre><div class="info"><div class="info">Same as TODO reference : List.for_all, but for a two-argument predicate.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<pre><span class="VALexists2_exn"><span class="keyword">val</span> exists2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; bool) -&gt; bool</code></pre><div class="info"><div class="info">Same as TODO reference : List.exists, but for a two-argument predicate. Raise
+ <code class="code">Invalid_argument</code> if the end of one list is reached before the end of the
+ other.</div></div>
+<pre><span class="VALfilter"><span class="keyword">val</span> filter</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">filter p l</code> returns all the elements of the list <code class="code">l</code> that satisfy the predicate <code class="code">p</code>.
+ The order of the elements in the input list is preserved.</div></div>
+<pre><span class="VALrev_filter"><span class="keyword">val</span> rev_filter</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Like <code class="code">filter</code>, but reverses the order of the input list</div></div>
+<pre><span class="VALfilteri"><span class="keyword">val</span> filteri</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALpartition_map"><span class="keyword">val</span> partition_map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; [ `Fst of 'b | `Snd of 'c ]) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> * 'c <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">partition_map t ~f</code> partitions <code class="code">t</code> according to <code class="code">f</code>.</div></div>
+<pre><span class="VALpartition_tf"><span class="keyword">val</span> partition_tf</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> * 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">partition_tf p l</code> returns a pair of lists <code class="code">(l1, l2)</code>, where <code class="code">l1</code> is the list of all the
+ elements of <code class="code">l</code> that satisfy the predicate <code class="code">p</code>, and <code class="code">l2</code> is the list of all the
+ elements of <code class="code">l</code> that do not satisfy <code class="code">p</code>. The order of the elements in the input list
+ is preserved. The &quot;tf&quot; suffix is mnemonic to remind readers at a call that the result
+ is (trues, falses).</div></div>
+<pre><span class="VALsplit_n"><span class="keyword">val</span> split_n</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> * 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">split_n n [e1; ...; em]</code> is <code class="code">([e1; ...; en], [en+1; ...; em])</code>. If <code class="code">n &gt; m</code>,
+ <code class="code">([e1; ...; em], [])</code> is returned. If <code class="code">n &lt; 0</code>, <code class="code">([], [e1; ...; em])</code> is
+ returned.</div></div>
+<pre><span class="VALsort"><span class="keyword">val</span> sort</span> : <code class="type">cmp:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Sort a list in increasing order according to a comparison function. The comparison
+ function must return 0 if its arguments compare as equal, a positive integer if the
+ first is greater, and a negative integer if the first is smaller (see Array.sort for a
+ complete specification). For example, TODO reference : Pervasives.compare is a suitable comparison
+ function.<br/> The current implementation uses Merge Sort. It runs in constant heap space and
+ logarithmic stack space.<br/> Presently, the sort is stable, meaning that two equal elements in the input will be in
+ the same order in the output.</div></div>
+<pre><span class="VALstable_sort"><span class="keyword">val</span> stable_sort</span> : <code class="type">cmp:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Same as sort, but guaranteed to be stable</div></div>
+<pre><span class="VALmerge"><span class="keyword">val</span> merge</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; cmp:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Merge two lists: assuming that <code class="code">l1</code> and <code class="code">l2</code> are sorted according to the comparison
+ function <code class="code">cmp</code>, <code class="code">merge cmp l1 l2</code> will return a sorted list containting all the
+ elements of <code class="code">l1</code> and <code class="code">l2</code>. If several elements compare equal, the elements of <code class="code">l1</code>
+ will be before the elements of <code class="code">l2</code>.</div></div>
+<pre><span class="VALhd"><span class="keyword">val</span> hd</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a option</code></pre>
+<pre><span class="VALtl"><span class="keyword">val</span> tl</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> option</code></pre>
+<pre><span class="VALhd_exn"><span class="keyword">val</span> hd_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a</code></pre><div class="info"><div class="info">Return the first element of the given list. Raise
+ <code class="code">Failure &quot;hd&quot;</code> if the list is empty.</div></div>
+<pre><span class="VALtl_exn"><span class="keyword">val</span> tl_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Return the given list without its first element. Raise <code class="code">Failure &quot;tl&quot;</code> if the list is
+ empty.</div></div>
+<pre><span class="VALfindi"><span class="keyword">val</span> findi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; bool) -&gt; (int * 'a) option</code></pre>
+<pre><span class="VALfind_exn"><span class="keyword">val</span> find_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a</code></pre><div class="info"><div class="info"><code class="code">find_exn t ~f</code> returns the first element of <code class="code">t</code> that satisfies <code class="code">f</code>. It raises
+ <code class="code">Not_found</code> if there is no such element.</div></div>
+<div class="info"><div class="info"><br/><h6 id="6_TITLE">Tail-recursive implementations of standard List operations</h6><br/></div></div>
+<pre><span class="VALappend"><span class="keyword">val</span> append</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">E.g. <code class="code">append [1; 2] [3; 4; 5]</code> is <code class="code">[1; 2; 3; 4; 5]</code></div></div>
+<pre><span class="VALmap"><span class="keyword">val</span> map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">List.map f [a1; ...; an]</code> applies function <code class="code">f</code> to <code class="code">a1, ..., an</code>, and builds the list
+ <code class="code">[f a1; ...; f an]</code> with the results returned by <code class="code">f</code>.</div></div>
+<pre><span class="VALconcat_map"><span class="keyword">val</span> concat_map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a>) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">concat_map t ~f</code> is <code class="code">concat (map t ~f)</code>, except that there is no guarantee about the
+ order in which <code class="code">f</code> is applied to the elements of <code class="code">t</code>.</div></div>
+<pre><span class="VALconcat_mapi"><span class="keyword">val</span> concat_mapi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a>) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">concat_mapi t ~f</code> is like concat_map, but passes the index as an argument</div></div>
+<pre><span class="VALmap2_exn"><span class="keyword">val</span> map2_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; 'c) -&gt; 'c <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">List.map2_exn f [a1; ...; an] [b1; ...; bn]</code> is <code class="code">[f a1 b1; ...; f an bn]</code>. Raise
+ <code class="code">Invalid_argument</code> if the two lists have different lengths.</div></div>
+<pre><span class="VALrev_map3_exn"><span class="keyword">val</span> rev_map3_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'c <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; 'c -&gt; 'd) -&gt; 'd <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALmap3_exn"><span class="keyword">val</span> map3_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'c <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; 'c -&gt; 'd) -&gt; 'd <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALrev_map_append"><span class="keyword">val</span> rev_map_append</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">rev_map_append ~f l1 l2</code> reverses <code class="code">l1</code> mapping <code class="code">f</code> over each
+ element, and appends the result to the front of <code class="code">l2</code>.</div></div>
+<pre><span class="VALfold_right"><span class="keyword">val</span> fold_right</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b -&gt; 'b) -&gt; init:'b -&gt; 'b</code></pre><div class="info"><div class="info"><code class="code">List.fold_right f [a1; ...; an] b</code> is
+ <code class="code">f a1 (f a2 (... (f an b) ...))</code>.</div></div>
+<pre><span class="VALunzip"><span class="keyword">val</span> unzip</span> : <code class="type">('a * 'b) <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> * 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Transform a list of pairs into a pair of lists:
+ <code class="code">unzip [(a1,b1); ...; (an,bn)]</code> is <code class="code">([a1; ...; an], [b1; ...; bn])</code>.</div></div>
+<pre><span class="VALzip"><span class="keyword">val</span> zip</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; ('a * 'b) <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> option</code></pre><div class="info"><div class="info">Transform a pair of lists into an (optional) list of pairs:
+ <code class="code">zip [a1; ...; an] [b1; ...; bn]</code> is <code class="code">[(a1,b1); ...; (an,bn)]</code>.
+ Returns None if the two lists have different lengths.</div></div>
+<pre><span class="VALzip_exn"><span class="keyword">val</span> zip_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; ('a * 'b) <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALmapi"><span class="keyword">val</span> mapi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; 'b) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">mapi is just like map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<pre><span class="VALrev_mapi"><span class="keyword">val</span> rev_mapi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; 'b) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; unit) -&gt; unit</code></pre><div class="info"><div class="info">iteri is just like iter, but it also passes in the index of each
+ element as the first argument to the iter'd function. Tail-recursive.</div></div>
+<pre><span class="VALfoldi"><span class="keyword">val</span> foldi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'b -&gt; 'a -&gt; 'b) -&gt; init:'b -&gt; 'b</code></pre><div class="info"><div class="info">foldi is just like fold, but it also passes in the index of each
+ element as the first argument to the folded function. Tail-recursive.</div></div>
+<pre><span class="VALreduce_exn"><span class="keyword">val</span> reduce_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'a -&gt; 'a) -&gt; 'a</code></pre><div class="info"><div class="info"><code class="code">reduce_exn f [a1; ...; an]</code> is <code class="code">f (... (f (f a1 a2) a3) ...) an</code>.
+ It fails on the empty list. Tail recursive.</div></div>
+<pre><span class="VALreduce"><span class="keyword">val</span> reduce</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'a -&gt; 'a) -&gt; 'a option</code></pre>
+<pre><span class="VALgroup"><span class="keyword">val</span> group</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; break:('a -&gt; 'a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">group l ~break</code> returns a list of lists (i.e., groups) whose concatenation is
+ equal to the original list. Each group is broken where break returns true on
+ a pair of successive elements.<br/> Example<br/> group ~break:(&lt;&gt;) <code class="code">'M';'i';'s';'s';'i';'s';'s';'i';'p';'p';'i'</code> -&gt;<br/> <code class="code">['M'];['i'];['s';'s'];['i'];['s';'s'];['i'];['p';'p'];['i']</code></div></div>
+<pre><span class="VALgroupi"><span class="keyword">val</span> groupi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; break:(int -&gt; 'a -&gt; 'a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">This is just like group, except that you get the index in the original list of the
+ current element along with the two elements.<br/> Example, group the chars of Mississippi into triples<br/> groupi ~break:(fun i _ _ -&gt; i mod 3 = 0)
+ <code class="code">'M';'i';'s';'s';'i';'s';'s';'i';'p';'p';'i'</code> -&gt;<br/> <code class="code">['M'; 'i'; 's']; ['s'; 'i'; 's']; ['s'; 'i'; 'p']; ['p'; 'i']</code></div></div>
+<pre><span class="VALlast"><span class="keyword">val</span> last</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a option</code></pre><div class="info"><div class="info">The final element of a list. The _exn version raises Invalid_argument on the empty
+ list.</div></div>
+<pre><span class="VALlast_exn"><span class="keyword">val</span> last_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a</code></pre>
+<pre><span class="VALremove_consecutive_duplicates"><span class="keyword">val</span> remove_consecutive_duplicates</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; equal:('a -&gt; 'a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">remove_consecutive_duplicates</code>. The same list with consecutive duplicates removed.
+ The relative order of the other elements is unaffected.</div></div>
+<pre><span class="VALdedup"><span class="keyword">val</span> dedup</span> : <code class="type">?compare:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">dedup</code> (de-duplicate). The same list with duplicates removed, but the
+ order is not guaranteed.</div></div>
+<pre><span class="VALcontains_dup"><span class="keyword">val</span> contains_dup</span> : <code class="type">?compare:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; bool</code></pre><div class="info"><div class="info"><code class="code">contains_dup</code> True if there are any two elements in the list which are the same.</div></div>
+<pre><span class="VALfind_a_dup"><span class="keyword">val</span> find_a_dup</span> : <code class="type">?compare:('a -&gt; 'a -&gt; int) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a option</code></pre><div class="info"><div class="info"><code class="code">find_a_dup</code> returns a duplicate from the list (no guarantees about which
+ duplicate you get), or None if there are no dups.</div></div>
+<pre><span class="EXCEPTIONDuplicate_found"><span class="keyword">exception</span> Duplicate_found</span> <span class="keyword">of</span> <code class="type">unit -&gt; Sexplib.Sexp.t * string</code></pre>
+<pre><span class="VALexn_if_dup"><span class="keyword">val</span> exn_if_dup</span> : <code class="type">?compare:('a -&gt; 'a -&gt; int) -&gt;
+?context:string -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; to_sexp:('a -&gt; Sexplib.Sexp.t) -&gt; unit</code></pre><div class="info"><div class="info"><code class="code">exn_if_dup ?compare ?context t ~to_sexp</code> will run <code class="code">find_a_dup</code> on <code class="code">t</code>, and raise
+ <code class="code">Duplicate_found</code> if a duplicate is found. The <code class="code">context</code> is the second argument of
+ the exception</div></div>
+<pre><span class="VALcount"><span class="keyword">val</span> count</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; int</code></pre><div class="info"><div class="info"><code class="code">count f l</code> is the number of elements in <code class="code">l</code> that satisfy the
+ predicate <code class="code">f</code>.</div></div>
+<pre><span class="VALrange"><span class="keyword">val</span> range</span> : <code class="type">?stride:int -&gt;
+?start:[ `exclusive | `inclusive ] -&gt;
+?stop:[ `exclusive | `inclusive ] -&gt; int -&gt; int -&gt; int <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">range ?stride ?start ?stop start_i stop_i</code> is the list of integers from <code class="code">start_i</code> to
+ <code class="code">stop_i</code>, stepping by <code class="code">stride</code>. If <code class="code">stride</code> &lt; 0 then we need <code class="code">start_i</code> &gt; <code class="code">stop_i</code> for
+ the result to be nonempty (or <code class="code">start_i</code> = <code class="code">stop_i</code> in the case where both bounds are
+ inclusive).</div></div>
+<pre><span class="VALinit"><span class="keyword">val</span> init</span> : <code class="type">int -&gt; f:(int -&gt; 'a) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">init f n</code> is <code class="code">[(f 0); (f 1); ...; (f (n-1))]</code>. It is an error if <code class="code">n &lt; 0</code>.</div></div>
+<pre><span class="VALrev_filter_map"><span class="keyword">val</span> rev_filter_map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b option) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">rev_filter_map f l</code> is the reversed sublist of <code class="code">l</code> containing
+ only elements for which <code class="code">f</code> returns <code class="code">Some e</code>.</div></div>
+<pre><span class="VALrev_filter_mapi"><span class="keyword">val</span> rev_filter_mapi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; 'b option) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">rev_filter_mapi is just like rev_filter_map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<pre><span class="VALfilter_map"><span class="keyword">val</span> filter_map</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; 'b option) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">filter_map f l</code> is the sublist of <code class="code">l</code> containing only elements
+ for which <code class="code">f</code> returns <code class="code">Some e</code>.</div></div>
+<pre><span class="VALfilter_mapi"><span class="keyword">val</span> filter_mapi</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:(int -&gt; 'a -&gt; 'b option) -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">filter_mapi is just like filter_map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<pre><span class="VALfilter_opt"><span class="keyword">val</span> filter_opt</span> : <code class="type">'a option <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">filter_opt l</code> is the sublist of <code class="code">l</code> containing only elements
+ which are <code class="code">Some e</code>. In other words, <code class="code">filter_opt l</code> = <code class="code">filter_map ~f:ident l</code>.</div></div>
+<div class="ocaml_module sig" name="Assoc"><pre><span class="keyword">module</span> <a href="?package=core_kernel&amp;module=Core_list.Assoc">Assoc</a> : <code class="type"><code class="code">sig</code> .. <code class="code">end</code></code></pre><div class="ocaml_module_content">
+<pre><span class="TYPEt"><span class="keyword">type</span> <code class="type">('a, 'b) </code>t</span> = <code class="type">('a * 'b) list</code></pre>
+<pre><span class="VALadd"><span class="keyword">val</span> add</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ?equal:('a -&gt; 'a -&gt; bool) -&gt; 'a -&gt; 'b -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a></code></pre>
+<pre><span class="VALfind"><span class="keyword">val</span> find</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ?equal:('a -&gt; 'a -&gt; bool) -&gt; 'a -&gt; 'b option</code></pre>
+<pre><span class="VALfind_exn"><span class="keyword">val</span> find_exn</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ?equal:('a -&gt; 'a -&gt; bool) -&gt; 'a -&gt; 'b</code></pre>
+<pre><span class="VALmem"><span class="keyword">val</span> mem</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ?equal:('a -&gt; 'a -&gt; bool) -&gt; 'a -&gt; bool</code></pre>
+<pre><span class="VALremove"><span class="keyword">val</span> remove</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ?equal:('a -&gt; 'a -&gt; bool) -&gt; 'a -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a></code></pre>
+<pre><span class="VALmap"><span class="keyword">val</span> map</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; f:('b -&gt; 'c) -&gt; ('a, 'c) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a></code></pre>
+<pre><span class="VALinverse"><span class="keyword">val</span> inverse</span> : <code class="type">('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ('b, 'a) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a></code></pre>
+<pre><span class="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type">('a -&gt; 'a -&gt; int) -&gt; ('b -&gt; 'b -&gt; int) -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; int</code></pre>
+<pre><span class="VALt_of_sexp"><span class="keyword">val</span> t_of_sexp</span> : <code class="type">(Sexplib.Sexp.t -&gt; 'a) -&gt;
+(Sexplib.Sexp.t -&gt; 'b) -&gt; Sexplib.Sexp.t -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a></code></pre>
+<pre><span class="VALsexp_of_t"><span class="keyword">val</span> sexp_of_t</span> : <code class="type">('a -&gt; Sexplib.Sexp.t) -&gt;
+('b -&gt; Sexplib.Sexp.t) -&gt; ('a, 'b) <a href="?package=core_kernel&amp;module=Core_list.Assoc&amp;type=t">t</a> -&gt; Sexplib.Sexp.t</code></pre></div></div>
+<div class="info"><div class="info">Note that <code class="code">sub</code>, unlike <code class="code">slice</code>, doesn't use python-style indices!</div></div>
+<pre><span class="VALsub"><span class="keyword">val</span> sub</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; pos:int -&gt; len:int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">sub pos len l</code> is the <code class="code">len</code>-element sublist of <code class="code">l</code>, starting at <code class="code">pos</code>.</div></div>
+<pre><span class="VALslice"><span class="keyword">val</span> slice</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">slice l start stop</code> returns a new list including elements <code class="code">l.(start)</code> through
+ <code class="code">l.(stop-1)</code>, normalized python-style.</div></div>
+<pre><span class="VALtake"><span class="keyword">val</span> take</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">take l n</code> is <code class="code">fst (split_n n l)</code>.
+ <code class="code">drop l n</code> is <code class="code">snd (split_n n l)</code>.</div></div>
+<pre><span class="VALdrop"><span class="keyword">val</span> drop</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALtake_while"><span class="keyword">val</span> take_while</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">take_while l ~f</code> returns the longest prefix of <code class="code">l</code> for which <code class="code">f</code> is <code class="code">true</code>.</div></div>
+<pre><span class="VALdrop_while"><span class="keyword">val</span> drop_while</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">drop_while l ~f</code> drops the longest prefix of <code class="code">l</code> for which <code class="code">f</code> is <code class="code">true</code>.</div></div>
+<pre><span class="VALsplit_while"><span class="keyword">val</span> split_while</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; f:('a -&gt; bool) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> * 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">split_while xs ~f = (take_while xs ~f, drop_while xs ~f)</code></div></div>
+<pre><span class="VALconcat"><span class="keyword">val</span> concat</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Concatenate a list of lists. The elements of the argument are all concatenated
+ together (in the same order) to give the result. Tail recursive over outer and inner
+ lists.</div></div>
+<pre><span class="VALconcat_no_order"><span class="keyword">val</span> concat_no_order</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info">Same as <code class="code">concat</code> but faster and without preserving any ordering (ie for lists that are
+ essentially viewed as multi-sets.</div></div>
+<pre><span class="VALcons"><span class="keyword">val</span> cons</span> : <code class="type">'a -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALcartesian_product"><span class="keyword">val</span> cartesian_product</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'b <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; ('a * 'b) <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type">f:('a -&gt; string) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; string</code></pre>
+<pre><span class="VALpermute"><span class="keyword">val</span> permute</span> : <code class="type">?random_state:<a href="?package=core_kernel&amp;module=Core_random.State&amp;type=t">Core_random.State.t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">permute ?random_state t</code> returns a permutation of <code class="code">t</code>.<br/> <code class="code">permute</code> side affects <code class="code">random_state</code> by repeated calls to <code class="code">Random.State.int</code>.
+ If <code class="code">random_state</code> is not supplied, <code class="code">permute</code> uses <code class="code">Random.State.default</code>.</div></div>
+<pre><span class="VALis_sorted"><span class="keyword">val</span> is_sorted</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; compare:('a -&gt; 'a -&gt; int) -&gt; bool</code></pre>
+<pre><span class="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; cmp:('a -&gt; 'a -&gt; int) -&gt; int</code></pre><div class="info"><div class="info">lexicographic</div></div>
+<pre><span class="VALequal"><span class="keyword">val</span> equal</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; equal:('a -&gt; 'a -&gt; bool) -&gt; bool</code></pre>
+<div class="ocaml_module sig" name="Infix"><pre><span class="keyword">module</span> <a href="?package=core_kernel&amp;module=Core_list.Infix">Infix</a> : <code class="type"><code class="code">sig</code> .. <code class="code">end</code></code></pre><div class="ocaml_module_content">
+<pre><span class="VAL@"><span class="keyword">val</span> @</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre></div></div>
+<pre><span class="VALtranspose"><span class="keyword">val</span> transpose</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> option</code></pre><div class="info"><div class="info"><code class="code">transpose m</code> transposes the rows and columns of the matrix <code class="code">m</code>,
+ considered as either a row of column lists or (dually) a column of row lists.<br/> Example,<br/> transpose <code class="code">[1;2;3];[4;5;6]</code> = <code class="code">[1;4];[2;5];[3;6]</code><br/> On non-empty rectangular matrices, <code class="code">transpose</code> is an involution
+ (i.e., <code class="code">transpose (transpose m) = m</code>). Transpose returns None when called
+ on lists of lists with non-uniform lengths.</div></div>
+<pre><span class="VALtranspose_exn"><span class="keyword">val</span> transpose_exn</span> : <code class="type">'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre><div class="info"><div class="info"><code class="code">transpose_exn</code> transposes the rows and columns of its argument, throwing exception if
+ the list is not rectangular.</div></div>
+<pre><span class="VALintersperse"><span class="keyword">val</span> intersperse</span> : <code class="type">'a list -&gt; sep:'a -&gt; 'a list</code></pre><div class="info"><div class="info"><code class="code">intersperse xs ~sep</code> places <code class="code">sep</code> between adjacent elements of <code class="code">xs</code>.
+ e.g. <code class="code">intersperse [1;2;3] ~sep:0 = [1;0;2;0;3]</code></div></div>
+<pre><span class="VALt_of_sexp"><span class="keyword">val</span> t_of_sexp</span> : <code class="type">(Sexplib.Sexp.t -&gt; 'a) -&gt; Sexplib.Sexp.t -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a></code></pre>
+<pre><span class="VALsexp_of_t"><span class="keyword">val</span> sexp_of_t</span> : <code class="type">('a -&gt; Sexplib.Sexp.t) -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> -&gt; Sexplib.Sexp.t</code></pre>
+<pre><span class="VALbin_t"><span class="keyword">val</span> bin_t</span> : <code class="type">'a Bin_prot.Type_class.t -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Type_class.t</code></pre>
+<pre><span class="VALbin_read_t"><span class="keyword">val</span> bin_read_t</span> : <code class="type">'a Bin_prot.Unsafe_read_c.reader -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Read_ml.reader</code></pre>
+<pre><span class="VALbin_read_t_"><span class="keyword">val</span> bin_read_t_</span> : <code class="type">'a Bin_prot.Unsafe_read_c.reader -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Unsafe_read_c.reader</code></pre>
+<pre><span class="VALbin_read_t__"><span class="keyword">val</span> bin_read_t__</span> : <code class="type">'a Bin_prot.Unsafe_read_c.reader -&gt;
+(int -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a>) Bin_prot.Unsafe_read_c.reader</code></pre>
+<pre><span class="VALbin_reader_t"><span class="keyword">val</span> bin_reader_t</span> : <code class="type">'a Bin_prot.Type_class.reader -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Type_class.reader</code></pre>
+<pre><span class="VALbin_size_t"><span class="keyword">val</span> bin_size_t</span> : <code class="type">'a Bin_prot.Size.sizer -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Size.sizer</code></pre>
+<pre><span class="VALbin_write_t"><span class="keyword">val</span> bin_write_t</span> : <code class="type">'a Bin_prot.Unsafe_write_c.writer -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Write_ml.writer</code></pre>
+<pre><span class="VALbin_write_t_"><span class="keyword">val</span> bin_write_t_</span> : <code class="type">'a Bin_prot.Unsafe_write_c.writer -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Unsafe_write_c.writer</code></pre>
+<pre><span class="VALbin_writer_t"><span class="keyword">val</span> bin_writer_t</span> : <code class="type">'a Bin_prot.Type_class.writer -&gt; 'a <a href="?package=core_kernel&amp;module=Core_list&amp;type=t">t</a> Bin_prot.Type_class.writer</code></pre>
+<div class="info"><div class="info"><code class="code">of_list</code> is the identity function. It is useful so that the <code class="code">List</code> module matches
+ the same signature that other container modules do, namely:<br/> <pre class="codepre"><code class="code">
+ val of_list : 'a List.t -&gt; 'a t
+ </code></pre></div></div>
+<div class="info"><div class="info">Return the <code class="code">n</code>-th element of the given list.
+ The first element (head of the list) is at position 0.
+ Raise <code class="code">Failure &quot;nth&quot;</code> if the list is too short.
+ Raise <code class="code">Invalid_argument &quot;List.nth&quot;</code> if <code class="code">n</code> is negative.</div></div>
+<div class="info"><div class="info">List reversal.</div></div>
+<div class="info"><div class="info"><code class="code">List.rev_append l1 l2</code> reverses <code class="code">l1</code> and concatenates it to <code class="code">l2</code>. This is equivalent
+ to <code class="code">(</code>TODO reference : List.rev<code class="code"> l1) @ l2</code>, but <code class="code">rev_append</code> is more efficient.</div></div>
+<div class="info"><div class="info"><code class="code">List.rev_map f l</code> gives the same result as
+ TODO reference : List.rev<code class="code"> (</code>TODO reference : ListLabels.map<code class="code"> f l)</code>, but is more efficient.</div></div>
+<div class="info"><div class="info"><code class="code">List.iter2_exn f [a1; ...; an] [b1; ...; bn]</code> calls in turn
+ <code class="code">f a1 b1; ...; f an bn</code>.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<div class="info"><div class="info"><code class="code">List.rev_map2_exn f l1 l2</code> gives the same result as
+ TODO reference : List.rev<code class="code"> (</code>TODO reference : List.map2_exn<code class="code"> f l1 l2)</code>, but is more efficient.</div></div>
+<div class="info"><div class="info"><code class="code">List.fold2_exn f a [b1; ...; bn] [c1; ...; cn]</code> is
+ <code class="code">f (... (f (f a b1 c1) b2 c2) ...) bn cn</code>.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<div class="info"><div class="info">Same as TODO reference : List.for_all, but for a two-argument predicate.
+ Raise <code class="code">Invalid_argument</code> if the two lists have
+ different lengths.</div></div>
+<div class="info"><div class="info">Same as TODO reference : List.exists, but for a two-argument predicate. Raise
+ <code class="code">Invalid_argument</code> if the end of one list is reached before the end of the
+ other.</div></div>
+<div class="info"><div class="info"><code class="code">filter p l</code> returns all the elements of the list <code class="code">l</code> that satisfy the predicate <code class="code">p</code>.
+ The order of the elements in the input list is preserved.</div></div>
+<div class="info"><div class="info">Like <code class="code">filter</code>, but reverses the order of the input list</div></div>
+<div class="info"><div class="info"><code class="code">partition_map t ~f</code> partitions <code class="code">t</code> according to <code class="code">f</code>.</div></div>
+<div class="info"><div class="info"><code class="code">partition_tf p l</code> returns a pair of lists <code class="code">(l1, l2)</code>, where <code class="code">l1</code> is the list of all the
+ elements of <code class="code">l</code> that satisfy the predicate <code class="code">p</code>, and <code class="code">l2</code> is the list of all the
+ elements of <code class="code">l</code> that do not satisfy <code class="code">p</code>. The order of the elements in the input list
+ is preserved. The &quot;tf&quot; suffix is mnemonic to remind readers at a call that the result
+ is (trues, falses).</div></div>
+<div class="info"><div class="info"><code class="code">split_n n [e1; ...; em]</code> is <code class="code">([e1; ...; en], [en+1; ...; em])</code>. If <code class="code">n &gt; m</code>,
+ <code class="code">([e1; ...; em], [])</code> is returned. If <code class="code">n &lt; 0</code>, <code class="code">([], [e1; ...; em])</code> is
+ returned.</div></div>
+<div class="info"><div class="info">Sort a list in increasing order according to a comparison function. The comparison
+ function must return 0 if its arguments compare as equal, a positive integer if the
+ first is greater, and a negative integer if the first is smaller (see Array.sort for a
+ complete specification). For example, TODO reference : Pervasives.compare is a suitable comparison
+ function.<br/> The current implementation uses Merge Sort. It runs in constant heap space and
+ logarithmic stack space.<br/> Presently, the sort is stable, meaning that two equal elements in the input will be in
+ the same order in the output.</div></div>
+<div class="info"><div class="info">Same as sort, but guaranteed to be stable</div></div>
+<div class="info"><div class="info">Merge two lists: assuming that <code class="code">l1</code> and <code class="code">l2</code> are sorted according to the comparison
+ function <code class="code">cmp</code>, <code class="code">merge cmp l1 l2</code> will return a sorted list containting all the
+ elements of <code class="code">l1</code> and <code class="code">l2</code>. If several elements compare equal, the elements of <code class="code">l1</code>
+ will be before the elements of <code class="code">l2</code>.</div></div>
+<div class="info"><div class="info">Return the first element of the given list. Raise
+ <code class="code">Failure &quot;hd&quot;</code> if the list is empty.</div></div>
+<div class="info"><div class="info">Return the given list without its first element. Raise <code class="code">Failure &quot;tl&quot;</code> if the list is
+ empty.</div></div>
+<div class="info"><div class="info"><code class="code">find_exn t ~f</code> returns the first element of <code class="code">t</code> that satisfies <code class="code">f</code>. It raises
+ <code class="code">Not_found</code> if there is no such element.</div></div>
+<div class="info"><div class="info"><br/><h6 id="6_TITLE">Tail-recursive implementations of standard List operations</h6><br/></div></div>
+<div class="info"><div class="info">E.g. <code class="code">append [1; 2] [3; 4; 5]</code> is <code class="code">[1; 2; 3; 4; 5]</code></div></div>
+<div class="info"><div class="info"><code class="code">List.map f [a1; ...; an]</code> applies function <code class="code">f</code> to <code class="code">a1, ..., an</code>, and builds the list
+ <code class="code">[f a1; ...; f an]</code> with the results returned by <code class="code">f</code>.</div></div>
+<div class="info"><div class="info"><code class="code">concat_map t ~f</code> is <code class="code">concat (map t ~f)</code>, except that there is no guarantee about the
+ order in which <code class="code">f</code> is applied to the elements of <code class="code">t</code>.</div></div>
+<div class="info"><div class="info"><code class="code">concat_mapi t ~f</code> is like concat_map, but passes the index as an argument</div></div>
+<div class="info"><div class="info"><code class="code">List.map2_exn f [a1; ...; an] [b1; ...; bn]</code> is <code class="code">[f a1 b1; ...; f an bn]</code>. Raise
+ <code class="code">Invalid_argument</code> if the two lists have different lengths.</div></div>
+<div class="info"><div class="info"><code class="code">rev_map_append ~f l1 l2</code> reverses <code class="code">l1</code> mapping <code class="code">f</code> over each
+ element, and appends the result to the front of <code class="code">l2</code>.</div></div>
+<div class="info"><div class="info"><code class="code">List.fold_right f [a1; ...; an] b</code> is
+ <code class="code">f a1 (f a2 (... (f an b) ...))</code>.</div></div>
+<div class="info"><div class="info">Transform a list of pairs into a pair of lists:
+ <code class="code">unzip [(a1,b1); ...; (an,bn)]</code> is <code class="code">([a1; ...; an], [b1; ...; bn])</code>.</div></div>
+<div class="info"><div class="info">Transform a pair of lists into an (optional) list of pairs:
+ <code class="code">zip [a1; ...; an] [b1; ...; bn]</code> is <code class="code">[(a1,b1); ...; (an,bn)]</code>.
+ Returns None if the two lists have different lengths.</div></div>
+<div class="info"><div class="info">mapi is just like map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<div class="info"><div class="info">iteri is just like iter, but it also passes in the index of each
+ element as the first argument to the iter'd function. Tail-recursive.</div></div>
+<div class="info"><div class="info">foldi is just like fold, but it also passes in the index of each
+ element as the first argument to the folded function. Tail-recursive.</div></div>
+<div class="info"><div class="info"><code class="code">reduce_exn f [a1; ...; an]</code> is <code class="code">f (... (f (f a1 a2) a3) ...) an</code>.
+ It fails on the empty list. Tail recursive.</div></div>
+<div class="info"><div class="info"><code class="code">group l ~break</code> returns a list of lists (i.e., groups) whose concatenation is
+ equal to the original list. Each group is broken where break returns true on
+ a pair of successive elements.<br/> Example<br/> group ~break:(&lt;&gt;) <code class="code">'M';'i';'s';'s';'i';'s';'s';'i';'p';'p';'i'</code> -&gt;<br/> <code class="code">['M'];['i'];['s';'s'];['i'];['s';'s'];['i'];['p';'p'];['i']</code></div></div>
+<div class="info"><div class="info">This is just like group, except that you get the index in the original list of the
+ current element along with the two elements.<br/> Example, group the chars of Mississippi into triples<br/> groupi ~break:(fun i _ _ -&gt; i mod 3 = 0)
+ <code class="code">'M';'i';'s';'s';'i';'s';'s';'i';'p';'p';'i'</code> -&gt;<br/> <code class="code">['M'; 'i'; 's']; ['s'; 'i'; 's']; ['s'; 'i'; 'p']; ['p'; 'i']</code></div></div>
+<div class="info"><div class="info">The final element of a list. The _exn version raises Invalid_argument on the empty
+ list.</div></div>
+<div class="info"><div class="info"><code class="code">remove_consecutive_duplicates</code>. The same list with consecutive duplicates removed.
+ The relative order of the other elements is unaffected.</div></div>
+<div class="info"><div class="info"><code class="code">dedup</code> (de-duplicate). The same list with duplicates removed, but the
+ order is not guaranteed.</div></div>
+<div class="info"><div class="info"><code class="code">contains_dup</code> True if there are any two elements in the list which are the same.</div></div>
+<div class="info"><div class="info"><code class="code">find_a_dup</code> returns a duplicate from the list (no guarantees about which
+ duplicate you get), or None if there are no dups.</div></div>
+<div class="info"><div class="info"><code class="code">exn_if_dup ?compare ?context t ~to_sexp</code> will run <code class="code">find_a_dup</code> on <code class="code">t</code>, and raise
+ <code class="code">Duplicate_found</code> if a duplicate is found. The <code class="code">context</code> is the second argument of
+ the exception</div></div>
+<div class="info"><div class="info"><code class="code">count f l</code> is the number of elements in <code class="code">l</code> that satisfy the
+ predicate <code class="code">f</code>.</div></div>
+<div class="info"><div class="info"><code class="code">range ?stride ?start ?stop start_i stop_i</code> is the list of integers from <code class="code">start_i</code> to
+ <code class="code">stop_i</code>, stepping by <code class="code">stride</code>. If <code class="code">stride</code> &lt; 0 then we need <code class="code">start_i</code> &gt; <code class="code">stop_i</code> for
+ the result to be nonempty (or <code class="code">start_i</code> = <code class="code">stop_i</code> in the case where both bounds are
+ inclusive).</div></div>
+<div class="info"><div class="info"><code class="code">init f n</code> is <code class="code">[(f 0); (f 1); ...; (f (n-1))]</code>. It is an error if <code class="code">n &lt; 0</code>.</div></div>
+<div class="info"><div class="info"><code class="code">rev_filter_map f l</code> is the reversed sublist of <code class="code">l</code> containing
+ only elements for which <code class="code">f</code> returns <code class="code">Some e</code>.</div></div>
+<div class="info"><div class="info">rev_filter_mapi is just like rev_filter_map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<div class="info"><div class="info"><code class="code">filter_map f l</code> is the sublist of <code class="code">l</code> containing only elements
+ for which <code class="code">f</code> returns <code class="code">Some e</code>.</div></div>
+<div class="info"><div class="info">filter_mapi is just like filter_map, but it also passes in the index of each
+ element as the first argument to the mapped function. Tail-recursive.</div></div>
+<div class="info"><div class="info"><code class="code">filter_opt l</code> is the sublist of <code class="code">l</code> containing only elements
+ which are <code class="code">Some e</code>. In other words, <code class="code">filter_opt l</code> = <code class="code">filter_map ~f:ident l</code>.</div></div>
+<div class="info"><div class="info">Note that <code class="code">sub</code>, unlike <code class="code">slice</code>, doesn't use python-style indices!</div></div>
+<div class="info"><div class="info"><code class="code">sub pos len l</code> is the <code class="code">len</code>-element sublist of <code class="code">l</code>, starting at <code class="code">pos</code>.</div></div>
+<div class="info"><div class="info"><code class="code">slice l start stop</code> returns a new list including elements <code class="code">l.(start)</code> through
+ <code class="code">l.(stop-1)</code>, normalized python-style.</div></div>
+<div class="info"><div class="info"><code class="code">take l n</code> is <code class="code">fst (split_n n l)</code>.
+ <code class="code">drop l n</code> is <code class="code">snd (split_n n l)</code>.</div></div>
+<div class="info"><div class="info"><code class="code">take_while l ~f</code> returns the longest prefix of <code class="code">l</code> for which <code class="code">f</code> is <code class="code">true</code>.</div></div>
+<div class="info"><div class="info"><code class="code">drop_while l ~f</code> drops the longest prefix of <code class="code">l</code> for which <code class="code">f</code> is <code class="code">true</code>.</div></div>
+<div class="info"><div class="info"><code class="code">split_while xs ~f = (take_while xs ~f, drop_while xs ~f)</code></div></div>
+<div class="info"><div class="info">Concatenate a list of lists. The elements of the argument are all concatenated
+ together (in the same order) to give the result. Tail recursive over outer and inner
+ lists.</div></div>
+<div class="info"><div class="info">Same as <code class="code">concat</code> but faster and without preserving any ordering (ie for lists that are
+ essentially viewed as multi-sets.</div></div>
+<div class="info"><div class="info"><code class="code">permute ?random_state t</code> returns a permutation of <code class="code">t</code>.<br/> <code class="code">permute</code> side affects <code class="code">random_state</code> by repeated calls to <code class="code">Random.State.int</code>.
+ If <code class="code">random_state</code> is not supplied, <code class="code">permute</code> uses <code class="code">Random.State.default</code>.</div></div>
+<div class="info"><div class="info">lexicographic</div></div>
+<div class="info"><div class="info"><code class="code">transpose m</code> transposes the rows and columns of the matrix <code class="code">m</code>,
+ considered as either a row of column lists or (dually) a column of row lists.<br/> Example,<br/> transpose <code class="code">[1;2;3];[4;5;6]</code> = <code class="code">[1;4];[2;5];[3;6]</code><br/> On non-empty rectangular matrices, <code class="code">transpose</code> is an involution
+ (i.e., <code class="code">transpose (transpose m) = m</code>). Transpose returns None when called
+ on lists of lists with non-uniform lengths.</div></div>
+<div class="info"><div class="info"><code class="code">transpose_exn</code> transposes the rows and columns of its argument, throwing exception if
+ the list is not rectangular.</div></div>
+<div class="info"><div class="info"><code class="code">intersperse xs ~sep</code> places <code class="code">sep</code> between adjacent elements of <code class="code">xs</code>.
+ e.g. <code class="code">intersperse [1;2;3] ~sep:0 = [1;0;2;0;3]</code></div></div>
+</div>
View
87 src/site/platform/index.md
@@ -0,0 +1,87 @@
+<!-- ((! set title OCaml Platform !)) ((! set platform !)) -->
+
+<div class="container">
+ <h1>Platform</h1>
+ <div class="row">
+ <div id="platform-logo" class="span2">
+ <img src="/img/ocaml-large.png" alt="OCaml">
+ </div>
+ <section id="platform-leader" class="span7">
+ <h1>OCaml Platform</h1>
+ <p>The OCaml Platform represents the best way for developers, both new and old, to write software in OCaml. It combines the core OCaml compiler with a coherent set of tools, documentation, libraries and testing resources. It’s a project led by the <a href="/community/support">OCaml Labs</a> group in Cambridge, working closely with <a href="/community/support">OCaml-Pro</a> in France, and the requirements of the Platform are being guided by the industrial OCaml Consortium.</p>
+ <p>Creating and maintaining the Platform is an ambitious, long-term project. The v0.1 is not taking arbitrary decisions about which packages are included. Instead, we are first placing the industrial contributors on a common tool-chain and workflow so that it's easier to work together and share code. We expect a standard set of libraries to emerge from consensus over time as this workflow rises in adoption.</p>
+ </section>
+ <div id="platform-download" class="span3">
+ <p><a href="/docs/install" class="btn">Install</a></p>
+ <p>
+ <!-- <a href="#">Other systems</a> |
+ <a href="#">What's new?</a> -->
+ </p>
+ </div>
+ </div>
+ <div class="row">
+ <section class="span4 condensed">
+ <h1 class="ruled">Solid foundation</h1>
+ <p>The core of the platform is the OCaml compiler, which has been developed for more than 20 years at Inria by a group of leading researchers. OCaml supports functional, imperative and object-oriented styles of programming which ease the development of flexible and reliable software. It benefits from one of the most powerful type systems, equipped with parametric polymorphism and type inference. Also, in addition to its bytecode compiler, OCaml offers a compiler that produces efficient machine code for many architectures, which is extremely useful for creating software that can run in multiple environments.</p>
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">Advanced tools</h1>
+ <p>A platform is more than just the compiler and packages. The OCaml Platform combines the compiler with a set of tools and resources that make writing OCaml more productive and fun. OPAM, the OCaml Package Manager, provides a robust way to obtain packages, manage dependencies, and different versions of the compiler. OCamlot provides a distributed, continuous testing service for OPAM package quality and compatibility. This ensures that, before being merged, patches submitted to the OPAM repository are thoroughly tested on the variety of supported configurations, architectures, and systems. The resulting improved build and metadata quality in turn speeds up development for all OCaml developers through earlier error feed- back.</p>
+ </section>
+ <section class="span4 condensed">
+ <h1 class="ruled">Essential packages</h1>
+ <ul class="news-feed">
+ <li>
+ <article>
+ <h1><a href="/pkg/TBD">TBD</a></h1>
+ <p>Lorem ipsum dolor sit amet, consectetur</p>
+ <a href="/pkg/TBD">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ <li>
+ <article>
+ <h1><a href="/pkg/TBD">TBD</a></h1>
+ <p>Sed ut perspiciatis unde omnis iste natus</p>
+ <a href="/pkg/TBD">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ <li>
+ <article>
+ <h1><a href="/pkg/TBD">TBD</a></h1>
+ <p>Ut enim ad minim veniam, quis nostrud exercitation</p>
+ <a href="/pkg/TBD">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ <li>
+ <article>
+ <h1><a href="/pkg/TBD">TBD</a></h1>
+ <p>Laboris nisi ut aliquip ex ea commodo consequat</p>
+ <a href="/pkg/TBD">
+ <img src="/img/news.png" alt="News">
+ </a>
+ </article>
+ </li>
+ </ul>
+ <footer>
+ <p><a href="#">See full list</a></p>
+ </footer>
+ </section>
+ </div>
+ <div class="row">
+ <section class="span4 condensed">
+ <h1 class="ruled">Room to grow</h1>
+ <p>The OCaml Platform makes it quick and easy to be productive as it provides a set of well tested, and well documented packages that work on a range of supported platforms. Growing beyond those packages is trivially simple as OPAM allows you to easily access multiple versions of hundreds of packages, all of which have test information available and news feeds. The OCaml Platform represents the best way for developers, both new and old, to write software in OCaml.</p>
+ </section>
+ <section class="span8 condensed">
+ <h1>Packages</h1>
+ ((! input tpl/front_package.mpp !))
+ </section>
+ </div>
+</div>
+
View
28 src/site/releases/caml-light/faq.md
@@ -0,0 +1,28 @@
+<!-- ((! set title Caml Light - FAQ !)) -->
+
+# Caml Light - FAQ
+Is it possible to get error message in my own language?
+
+You can choose the language that Caml Light uses to write its messages.
+For this:
+
+* under Unix: define the `LANG` environment variable, or call the Caml
+ Light system with option `-lang`.
+* under Windows use the `-lang` option on the command line, or in the
+ `CAMLWIN.INI` file.
+* with a Macintosh, edit the resource of the Caml application.
+
+Language currently available are:
+
+* `fr`: french.
+* `es`: spanish.
+* `de`: german.
+* `it`: italian.
+* `src`: english.
+
+English is the default language for messages that cannot be translated.
+If your language is not yet available, and if you want to translate Caml
+Light messages (about 50 messages), you're welcome to contact the Caml
+team (mail to caml-light@inria.fr).
+
+
View
35 src/site/releases/caml-light/index.md
@@ -0,0 +1,35 @@
+<!-- ((! set title Caml Light !)) -->
+
+# Caml Light
+## Overview
+Caml Light is a lightweight, portable implementation of the Caml
+language. that runs on most Unix machines, as well as PC under Microsoft
+Windows. Because of its stable status, it is actively used in education.
+For most other uses, we recommend switching to its successor OCaml.
+
+Caml Light is implemented as a bytecode compiler, and fully
+bootstrapped. The runtime system and bytecode interpreter is written in
+standard C, hence Caml Light is easy to port to almost any 32 or 64 bit
+platform. The whole system is quite small: about 100K for the runtime
+system, and another 100K of bytecode for the compiler. Two megabytes of
+memory is enough to recompile the whole system.
+
+Debugging is possible by [tracing function calls in the same way as in
+OCaml](../debug.html). In the example therein, one should write
+`trace "fib";;` instead of `#trace fib;;` and `untrace "fib";;`
+instead of `#untrace fib;;`. There also exists a debugger, as a user
+contribution.
+
+Some common questions are answered in the [FAQ](faq.html).
+
+## Availability
+The Caml Light system is open source software, please read its
+[license](license.html) for more details. The [latest
+release](releases/) can be freely downloaded on this site, together with
+its [user&#39;s manual](http://caml.inria.fr/pub/docs/manual-caml-light/).
+See also [Functional programming using Caml
+Light](http://caml.inria.fr/pub/docs/fpcl/index.html) for an
+introduction to functional programming in general and the Caml Light
+language in particular.
+
+
View
620 src/site/releases/caml-light/license.md
@@ -0,0 +1,620 @@
+<!-- ((! set title Caml Light's License !)) -->
+
+# Caml Light's License
+In the following, “the Library” refers to all files marked “Copyright
+Inria” in the following directories and their sub-directories of the
+distribution:
+
+>
+> `runtime`, `config`, `contrib`, `lib`
+>
+
+and “the Compiler” refers to all files marked “Copyright Inria” in the
+other directories and their sub-directories of the distribution.
+
+The Compiler is distributed under the terms of the [Q Public
+License](#qpl) version 1.0 (included below).
+
+The Library is distributed under the terms of the [GNU Library General
+Public License](#lgpl) version 2 (included below).
+
+As a special exception to the GNU Library General Public License, you
+may link, statically or dynamically, a "work that uses the Library" with
+a publicly distributed version of the Library to produce an executable
+file containing portions of the Library, and distribute that executable
+file under terms of your choice, without any of the additional
+requirements listed in clause 6 of the GNU Library General Public
+License. By "a publicly distributed version of the Library", we mean
+either the unmodified Library as distributed by Inria, or a modified
+version of the Library that is distributed under the conditions defined
+in clause 3 of the GNU Library General Public License. This exception
+does not however invalidate any other reasons why the executable file
+might be covered by the GNU Library General Public License.
+
+## The Q Public License, version 1.0
+```tryocaml
+ Copyright (C) 1999 Troll Tech AS, Norway.
+ Everyone is permitted to copy and
+ distribute this license document.
+
+The intent of this license is to establish freedom to share and change
+the software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the
+copyright holder saying that it may be distributed under the terms of
+the Q Public License version 1.0. Such software is herein referred to
+as the Software. This license covers modification and distribution of
+the Software, use of third-party application programs based on the
+Software, and development of free software which uses the Software.
+
+ Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license
+provided you agree to and comply with any and all conditions in this
+license. Whole or partial distribution of the Software, or software
+items that link with the Software, in any form signifies acceptance of
+this license.
+
+2. You may copy and distribute the Software in unmodified form
+provided that the entire package, including - but not restricted to -
+copyright, trademark notices and disclaimers, as released by the
+initial developer of the Software, is distributed.
+
+3. You may make modifications to the Software and distribute your
+modifications, in a form that is separate from the Software, such as
+patches. The following restrictions apply to modifications:
+
+ a. Modifications must not alter or remove any copyright notices
+ in the Software.
+
+ b. When modifications to the Software are released under this
+ license, a non-exclusive royalty-free right is granted to the
+ initial developer of the Software to distribute your
+ modification in future versions of the Software provided such
+ versions remain available under these terms in addition to any
+ other license(s) of the initial developer.
+
+4. You may distribute machine-executable forms of the Software or
+machine-executable forms of modified versions of the Software,
+provided that you meet these restrictions:
+
+ a. You must include this license document in the distribution.
+
+ b. You must ensure that all recipients of the machine-executable
+ forms are also able to receive the complete machine-readable
+ source code to the distributed Software, including all
+ modifications, without any charge beyond the costs of data
+ transfer, and place prominent notices in the distribution
+ explaining this.
+
+ c. You must ensure that all modifications included in the
+ machine-executable forms are available under the terms of this
+ license.
+
+5. You may use the original or modified versions of the Software to
+compile, link and run application programs legally developed by you or
+by others.
+
+6. You may develop application programs, reusable components and other
+software items that link with the original or modified versions of the
+Software. These items, when distributed, are subject to the following
+requirements:
+
+ a. You must ensure that all recipients of machine-executable
+ forms of these items are also able to receive and use the
+ complete machine-readable source code to the items without any
+ charge beyond the costs of data transfer.
+
+ b. You must explicitly license all recipients of your items to
+ use and re-distribute original and modified versions of the
+ items in both machine-executable and source code forms. The
+ recipients must be able to do so without any charges whatsoever,
+ and they must be able to re-distribute to anyone they choose.
+
+ c. If the items are not available to the general public, and the
+ initial developer of the Software requests a copy of the items,
+ then you must supply one.
+
+ Limitations of Liability
+
+In no event shall the initial developers or copyright holders be
+liable for any damages whatsoever, including - but not restricted to -
+lost revenue or profits or other direct, indirect, special, incidental
+or consequential damages, even if they have been advised of the
+possibility of such damages, except to the extent invariable law, if
+any, provides otherwise.
+
+ No Warranty
+
+The Software and this license document are provided AS IS with NO
+WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN,
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ Choice of Law
+
+This license is governed by the Laws of France. Disputes shall be
+settled by the Court of Versailles.
+```
+## The GNU Library General Public License, version 2
+```tryocaml
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any