package delimited_parsing

  1. Overview
  2. Docs

Source file shared.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
open Core
open Async
include Delimited_kernel.Shared

let drop_lines r lines =
  let rec loop n =
    if n = 0
    then Deferred.unit
    else (
      match%bind Reader.read_line r with
      | `Ok _ -> loop (n - 1)
      | `Eof -> failwithf "file has fewer than %i lines" lines ())
  in
  loop lines
;;
OCaml

Innovation. Community. Security.