diff options
Diffstat (limited to 'ocaml/lib/infrastructure')
| -rw-r--r-- | ocaml/lib/infrastructure/dune | 15 | ||||
| -rw-r--r-- | ocaml/lib/infrastructure/file.ml | 4 | ||||
| -rw-r--r-- | ocaml/lib/infrastructure/file.mli | 3 |
3 files changed, 22 insertions, 0 deletions
diff --git a/ocaml/lib/infrastructure/dune b/ocaml/lib/infrastructure/dune new file mode 100644 index 0000000..b9d250f --- /dev/null +++ b/ocaml/lib/infrastructure/dune @@ -0,0 +1,15 @@ +(library + (name infrastructure) + (libraries + application + domain + fmt + logs) + (inline_tests) + (preprocess + (pps + ppx_deriving.show + ppx_deriving.eq + ppx_deriving.ord + ppx_inline_test + ppx_expect))) diff --git a/ocaml/lib/infrastructure/file.ml b/ocaml/lib/infrastructure/file.ml new file mode 100644 index 0000000..3b49c01 --- /dev/null +++ b/ocaml/lib/infrastructure/file.ml @@ -0,0 +1,4 @@ +let read filename = + let chan = In_channel.open_text filename in + let content = In_channel.input_all chan in + In_channel.close chan ; content diff --git a/ocaml/lib/infrastructure/file.mli b/ocaml/lib/infrastructure/file.mli new file mode 100644 index 0000000..17d4495 --- /dev/null +++ b/ocaml/lib/infrastructure/file.mli @@ -0,0 +1,3 @@ +val read : string -> string +(** [read filename] is the contents of [filename] as a string. + The empty string is returned if [filename] does not exist. *) |
