package core_kernel

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

Source file option_array.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
open! Import
include Base.Option_array

let to_array t = Array.init (length t) ~f:(fun i -> unsafe_get t i)
let of_array a = init (Array.length a) ~f:(fun i -> Array.unsafe_get a i)

include Binable.Of_binable1 (struct
    type 'a t = 'a option array [@@deriving sexp, bin_io]
  end)
    (struct
      type nonrec 'a t = 'a t

      let to_binable = to_array
      let of_binable = of_array
    end)