Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/clarus/smart-print
Browse files Browse the repository at this point in the history
  • Loading branch information
clarus committed Jan 22, 2014
2 parents 3f111d8 + 91a8d14 commit d82bd14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 =
Expand Down
5 changes: 4 additions & 1 deletion smartPrint.ml
Original file line number Diff line number Diff line change
@@ -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. *)
Expand Down Expand Up @@ -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
to_out_channel width tab stdout d

0 comments on commit d82bd14

Please sign in to comment.