package core_kernel

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file linked_queue.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
open! Import
module Binable = Binable0
module List = Base.List
module Queue = Base.Linked_queue
include Queue

include Bin_prot.Utils.Make_iterable_binable1 (struct
    type 'a t = 'a Queue.t
    type 'a el = 'a [@@deriving bin_io]

    let caller_identity =
      Bin_prot.Shape.Uuid.of_string "800df9a0-4992-11e6-881d-ffe1a5c8aced"
    ;;

    let module_name = Some "Core_kernel.Linked_queue"
    let length = length
    let iter = iter

    (* Bin_prot reads the elements in the same order they were written out, as determined
       by [iter].  So, we can ignore the index and just enqueue each element as it is read
       in. *)
    let init ~len ~next =
      let t = create () in
      for _ = 1 to len do
        enqueue t (next ())
      done;
      t
    ;;
  end)
OCaml

Innovation. Community. Security.