From 8983f3410a30d00c7b40e7bba4707b14a5f0d863 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 18 Oct 2022 15:42:59 -0400 Subject: [PATCH] doc --- src/Iter.mli | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Iter.mli b/src/Iter.mli index f2db278..28be7a6 100644 --- a/src/Iter.mli +++ b/src/Iter.mli @@ -65,10 +65,14 @@ val init : (int -> 'a) -> 'a t val cons : 'a -> 'a t -> 'a t (** [cons x l] yields [x], then yields from [l]. - Same as [append (singleton x) l] *) + Same as [append (singleton x) l]. + + Caution: it is advised not to build long iterators out of [cons], + because it's inefficient. Each additional [cons x i] adds one + layer of function call per item traversed in [i]. *) val snoc : 'a t -> 'a -> 'a t -(** Same as {!cons} but yields the element after iterating on [l] *) +(** Same as {!cons} but yields the element after iterating on [l]. *) val return : 'a -> 'a t (** Synonym to {!singleton} *)