Skip to content

ppx to generate a function that compares variant constructors

License

Notifications You must be signed in to change notification settings

rtsao/ppx_deriving_comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ppx_deriving_comparison

Generates a function that compares value constructors.

[@deriving comparison]
type foo =
  | A(bool)
  | B
  | C;

let () = {
  assert(foo_is_same_constructor(A(true), A(false)));
  assert(foo_is_same_constructor(B, B));
  assert(! foo_is_same_constructor(B, C));
};

About

ppx to generate a function that compares variant constructors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages