jobjo / popper

Property-based testing at ease
ISC License
43 stars 1 forks source link

Locate error for unbound value #52

Open vch9 opened 3 years ago

vch9 commented 3 years ago

Hi!

The following code:

type t = int [@@deriving popper]

Produces that error:

File "_none_", line 1: 
Error: Unbound value pp

I haven't look deeply on how you integrate the pp, but maybe it could be located on the type declaration structure ?

vch9 commented 3 years ago

I think it would also be nice to derive show and ord when you wan't to derive popper. I don't know if it's technically doable, it could also hide previous definition of a pretty-printter if the user doesn't know that popper derives show..

jobjo commented 3 years ago

Yeah, I also don't know if it's possible to make it to make [@@deriving popper] and expand it to [@@deriving show, ord, popper]. Will check.

Alternatively we could add our own show, ord derivers and remove the dependency on ppx_deriving_show/ord.

vch9 commented 3 years ago

Alternatively we could add our own show, ord derivers and remove the dependency on ppx_deriving_show/ord.

You mean require the user to write show and ord or to derivate yourself both of them ?

jobjo commented 3 years ago

You mean require the user to write show and ord or to derivate yourself both of them ?

I mean implement ppxs for both so that when you derive popper you also get the pp and compare functions. That also implies removing the dependency on ppx_deriving.