You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, everything works when building with dune.
The package ppx_show (version 0.2.0) does not work in UTop. Also, when it is loaded, ppx_compare will stop working.
How to reproduce
Start utop and run the following commands in it:
utop # #require "ppx_show";;
utop # type 'a binary_tree =
| Empty
| Node of 'a * 'a binary_tree * 'a binary_tree
[@@deriving show];;
Error: Error while running external preprocessor
Command line: /home/sheep/.opam/default/lib/ppx_show/./ppx.exe --as-ppx '/tmp/camlppx21011f' '/tmp/camlppxb4b1ef'
Then restart utop and run:
utop # #require "ppx_show";;
utop # #require "ppx_compare";;
utop # type 'a binary_tree =
| Empty
| Node of 'a * 'a binary_tree * 'a binary_tree
[@@deriving show];;
Error: Error while running external preprocessor
Command line: /home/sheep/.opam/default/lib/ppx_show/./ppx.exe --as-ppx '/tmp/camlppx137bfb' '/tmp/camlppx93ab35'
However, ppx_compare works without loading ppx_show:
utop # #require "ppx_compare";;
utop # type 'a binary_tree =
| Empty
| Node of 'a * 'a binary_tree * 'a binary_tree
[@@deriving equal,compare];;
type 'a binary_tree = Empty | Node of 'a * 'a binary_tree * 'a binary_tree
val equal_binary_tree :
('a -> 'a -> bool) -> 'a binary_tree -> 'a binary_tree -> bool = <fun>
val compare_binary_tree :
('a -> 'a -> int) -> 'a binary_tree -> 'a binary_tree -> int = <fun>
In addition, the following dune file simply works:
This should be fixed now! Thank you very much for the report. Another workaround would have been (the problem was to give a name to the current module in the toplevel for the path):
type'a binary_tree =
| Empty
| Nodeof'a*'abinary_tree*'abinary_tree
[@@deriving show {with_path=false}];;
Note that you need to #require "ppx_show.runtime" as well.
Description
First of all, everything works when building with dune.
The package
ppx_show
(version0.2.0
) does not work in UTop. Also, when it is loaded,ppx_compare
will stop working.How to reproduce
Start
utop
and run the following commands in it:Then restart utop and run:
However,
ppx_compare
works without loadingppx_show
:In addition, the following dune file simply works:
The current workaround is to use
ppx_deriving.show
in order to use the[@@deriving show]
ppx.Am I missing anything, or it is a bug of
ppx_show
library?The text was updated successfully, but these errors were encountered: