From 3e6830a294019323ef897cb93c2ef55c2d106032 Mon Sep 17 00:00:00 2001 From: Guillaume Claret Date: Tue, 17 Dec 2013 22:43:10 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index adc035f..c3feb6b 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,16 @@ Inspired by [PPrint](http://gallium.inria.fr/~fpottier/pprint/) of [François Po Install ------- -Download and run: +Using the package manager [OPAM](http://opam.ocaml.org/): + + $ opam install smart-print + +Else download the sources and run: $ make # make install -You can also `make doc` and `make test`. To compile your program with SmartPrint: +You can also `make doc` and `make test`. To compile your programs with SmartPrint: $ ocamlbuild my_program.native -libs smart_print @@ -194,7 +198,7 @@ writes: (fdsgo (x xdsdg))) in y -To display the `Tuple` we need repetition. It is possible to cheat using `OCaml.list`: +To display the `Tuple` we need repetition. It is possible to cheat using `OCaml.list` to print a list in OCaml's syntax: ```ocaml let rec pp (e : t) : SmartPrint.t = From 3a1c1f31866b302ef8f7ccb782599fe72d320b8a Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Sat, 28 Dec 2013 08:31:56 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Add=20operators=20to=20compile=20with=20OCa?= =?UTF-8?q?ml=20=E2=89=A5=204.00.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smartPrint.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smartPrint.ml b/smartPrint.ml index 8d1479a..90598b7 100644 --- a/smartPrint.ml +++ b/smartPrint.ml @@ -1,3 +1,6 @@ +external (|>) : 'a -> ('a -> 'b) -> 'b = "%revapply";; +external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply" + (* Separators. *) module Break = struct (* A break can be a whitespace or a newline if the text has to be splited. *) @@ -418,4 +421,4 @@ let to_out_channel (width : int) (tab : int) (c : out_channel) (d : t) : unit = (output_char c) (output_string c) output_sub_string d let to_stdout (width : int) (tab : int) (d : t) : unit = - to_out_channel width tab stdout d \ No newline at end of file + to_out_channel width tab stdout d