From 976048a85403fbb0751c34fa42703a3c47f6e918 Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Sat, 27 Jun 2026 00:11:43 +0200 Subject: refactor!: change repo directory structure for ocaml --- ocaml/lib/shared/file.ml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ocaml/lib/shared/file.ml (limited to 'ocaml/lib/shared/file.ml') diff --git a/ocaml/lib/shared/file.ml b/ocaml/lib/shared/file.ml new file mode 100644 index 0000000..74b5abc --- /dev/null +++ b/ocaml/lib/shared/file.ml @@ -0,0 +1,6 @@ +(** [read filename] is the contents of [filename] as a string. + The empty string is returned if [filename] does not exist. *) +let read filename = + let chan = In_channel.open_text filename in + let content = In_channel.input_all chan in + In_channel.close chan ; content -- cgit v1.2.3