mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 03:05:29 -05:00
update header of sequence.mli to explain some assumptions about sequences.
This commit is contained in:
parent
e23e1f8da1
commit
f1c101310c
1 changed files with 24 additions and 13 deletions
37
sequence.mli
37
sequence.mli
|
|
@ -11,21 +11,32 @@ form must reproduce the above copyright notice, this list of conditions and the
|
||||||
following disclaimer in the documentation and/or other materials provided with
|
following disclaimer in the documentation and/or other materials provided with
|
||||||
the distribution.
|
the distribution.
|
||||||
|
|
||||||
this software is provided by the copyright holders and contributors "as is" and
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
any express or implied warranties, including, but not limited to, the implied
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
warranties of merchantability and fitness for a particular purpose are
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
disclaimed. in no event shall the copyright holder or contributors be liable
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
for any direct, indirect, incidental, special, exemplary, or consequential
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
damages (including, but not limited to, procurement of substitute goods or
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
services; loss of use, data, or profits; or business interruption) however
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
caused and on any theory of liability, whether in contract, strict liability,
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
or tort (including negligence or otherwise) arising in any way out of the use
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
of this software, even if advised of the possibility of such damage.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
(** Transient iterators, that abstract on a finite sequence of elements. They
|
(** {1 Transient iterators, that abstract on a finite sequence of elements. *)
|
||||||
are designed to allow easy transfer (mappings) between data structures,
|
|
||||||
without defining n^2 conversions between the n types. *)
|
(** The iterators are designed to allow easy transfer (mappings) between data
|
||||||
|
structures, without defining n^2 conversions between the n types. The
|
||||||
|
implementation relies on the assumption that a sequence can be iterated
|
||||||
|
on as many times as needed; this choice allows for high performance
|
||||||
|
of many combinators. However, for transient iterators, the {!persistent}
|
||||||
|
function is provided, storing elements of a transient iterator
|
||||||
|
in memory; the iterator can then be used several times.
|
||||||
|
|
||||||
|
Note that some combinators also return sequences (e.g. {!group}). The
|
||||||
|
transformation is computed on the fly every time one iterates over
|
||||||
|
the resulting sequence. If a transformation performs heavy computation,
|
||||||
|
{!persistent} can also be used as intermediate storage. *)
|
||||||
|
|
||||||
type +'a t = ('a -> unit) -> unit
|
type +'a t = ('a -> unit) -> unit
|
||||||
(** Sequence abstract iterator type, representing a finite sequence of
|
(** Sequence abstract iterator type, representing a finite sequence of
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue