package sherlodoc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Search engine for OCaml documentation
Install
dune-project
Dependency
Authors
Maintainers
Sources
odoc-3.2.1.tbz
sha256=d45eb125514839fd9ac27702bb4938d1b4f3b6978e9b16ab9673ea067245affc
sha512=3555386b4770a7caa8ec903683bde5ecdc41d5e57ffaee617d5da225c747bbd1e9c1d2677f4df97e96bbdfc69f580ea83b1b92b933ea40a436a658788b677bbc
doc/src/sherlodoc.query/io.ml.html
Source file io.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 40module type S = sig (* avoids a dependency on lwt for sherlodoc.js *) type 'a t val return : 'a -> 'a t val map : 'a t -> ('a -> 'b) -> 'b t val bind : 'a t -> ('a -> 'b t) -> 'b t end module Seq (Io : S) = struct type 'a t = unit -> 'a node Io.t and 'a node = | Nil | Cons of 'a * 'a t let rec of_seq s () = match s () with | Seq.Nil -> Io.return Nil | Cons (x, xs) -> Io.return (Cons (x, of_seq xs)) let rec take n xs () = if n = 0 then Io.return Nil else begin Io.map (xs ()) @@ function | Nil -> Nil | Cons (x, xs) -> Cons (x, take (n - 1) xs) end let rec to_list acc s = Io.bind (s ()) @@ function | Nil -> Io.return (List.rev acc) | Cons (x, xs) -> to_list (x :: acc) xs let to_list s = to_list [] s end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>