Conversation
|
I have this passing[*] validateJVM locally, but it has to build against a version of singleton-ops with fthomas/singleton-ops#134, I'm using a publishLocal against head of master. [*] a few things are disabled |
|
I applause the macroless One quick question: Is |
|
@fthomas that's right, I only implemented |
|
Probably obvious from the PR diff, and my comments, but worth calling out that this does add |
|
My thoughts with regards to WDYT, @erikerlandson? |
@fthomas I have no use cases that would need the The role of expressing predicate constraints on literal types is arguably the domain of singleton-ops, using forms like |
|
just as a use-case reference, here is how I'm applying |
|
@fthomas I removed RefinedLT and equalValidateInference. There were two impacts.
property("Exists[A] ==> Exists[B]") = secure {
Inference[Contains[W.`'5'`.T], Exists[Digit]].isValid
}
val a: Char Refined Equal[W.`'0'`.T] = '0'
val b: Char Refined Digit = a |
f198171 to
e54a777
Compare
A candidate fix for #755 that refactors
==>to be macroless: if a valid inference cannot be proven, thenP1 ==> P2will fail to manifest. It no longer has a boolean field that is checked via macro.Introduces a compile-time version of
RefinedcalledRefinedLT, which tests a literal typeL's value against a corresponding predicateP. So the use of macros has been pushed from==>toRefinedLT, where the macros are used to extract literal-type value and run the validator against it.This PR is currently a bit rough - a few unit tests are failing, or failing to compile, which appear to work OK when I run them in the REPL. I also hacked around the old
.isValidbased unit-testing using a shim that made kittens cry.