package progress

  1. Overview
  2. Docs
User-definable progress bars

Install

Dune Dependency

Authors

Maintainers

Sources

terminal-0.2.1.tbz
sha256=7ae7f5c5a2db88107d0b3fd37d5344f066921270a3e74d56dd13457feb9e586e
sha512=3828ac568e447e5f1e59450ee48491c256d8bc77abe234190e14e2db5be7b81f379837083f0eb28ea9572fce2781fd0addd7adc1701947c0b2de9d8319ace042

doc/src/progress.engine/import.ml.html

Source file import.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(*————————————————————————————————————————————————————————————————————————————
   Copyright (c) 2020–2021 Craig Ferguson <me@craigfe.io>
   Distributed under the MIT license. See terms at the end of this file.
  ————————————————————————————————————————————————————————————————————————————*)

include Stdlib_ext

module Vector = struct
  include Vector

  let iter ~f t = iter f t

  let iteri_from ~f i t =
    for i = i to length t - 1 do
      f i (unsafe_get t i)
    done

  let insert t k v =
    Vector.push t v (* Dummy insertion to expand *);
    for i = Vector.length t - 1 downto k + 1 do
      Vector.set t i (Vector.get t (pred i))
    done;
    Vector.set t k v

  let get_exn = get
  let get = `shadowed
end
(*————————————————————————————————————————————————————————————————————————————
   Copyright (c) 2020–2021 Craig Ferguson <me@craigfe.io>

   Permission to use, copy, modify, and/or distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   DEALINGS IN THE SOFTWARE.
  ————————————————————————————————————————————————————————————————————————————*)
OCaml

Innovation. Community. Security.