2

How can I use ppx derive (https://github.com/ocaml-ppx/ppx_deriving) in my utop?

For example, I have to following code:

module A = struct 
  module T = struct
    type t = int [@@deriving hash, sexp, compare]
  end
  include Core_kernel.Hashable.Make(T)
end;;
David 天宇 Wong
  • 3,724
  • 4
  • 35
  • 47

1 Answers1

4

Simply entering:

#require "ppx_jane";;

within utop will make these macros work

David 天宇 Wong
  • 3,724
  • 4
  • 35
  • 47
  • 1
    `utop[18]> #require "ppx_jane";;` `utop[19]> type abc = A | B | C [@@deriving show];;` `Error: Ppxlib.Deriving: 'show' is not a supported type deriving generator` – Vasiliy Yorkin Sep 25 '22 at 22:31