How to use ppx derive in utop?

502 Views Asked by At

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;;
1

There are 1 best solutions below

1
David 天宇 Wong On

Simply entering:

#require "ppx_jane";;

within utop will make these macros work