📚Cheatsheets

Cheatsheet collection for go, rust and javascript.

Read file to string

Read file to string in OCaml.

let read_whole_file (file_path: string): string = 
  let ch = open_in file_path in
  let n = in_channel_length ch in
  let s = really_input_string ch n in
  close_in ch;
  s