These are chat archives for fthomas/refined

17th
Dec 2017
Nicolas Rinaudo
@nrinaudo
Dec 17 2017 13:12
@fthomas alright, I'll have a look when I finally can make some time for this - I'm hoping during the christmas break
although I just spotted another issue of interest to me - a scopt module, and we do use scopt quite a bit at work...
(and since I just worked out that you could in fact get a derived Arbitrary[String Refined NonEmpty], the collection bit is less urgent for me since my use case is currently covered)
Frank S. Thomas
@fthomas
Dec 17 2017 22:03
@nrinaudo how do you get an Arbitrary for NonEmptyString? Via the eu.timepit.refined.scalacheck.any module?
Nicolas Rinaudo
@nrinaudo
Dec 17 2017 22:05
well, erm... I'm pretty sure I got that from your documentation :)
but yes, that's how it works
I haven't even checked it, but my assumption is that this relies on Gen.suchThat - which is fine for something like NonEmpty, since it's highly unlikely to ever cause test case generation to fail
Frank S. Thomas
@fthomas
Dec 17 2017 22:07
right, it calls Gen.filter but I guess that is similar to suchThat
Nicolas Rinaudo
@nrinaudo
Dec 17 2017 22:08
def filter(p: T => Boolean): Gen[T] = suchThat(p)
similar indeed
Frank S. Thomas
@fthomas
Dec 17 2017 22:08
:-)
Frank S. Thomas
@fthomas
Dec 17 2017 22:21
It is great if that works for you. And you're right that in the case of NonEmpty that discarded values probably won't be a problem in practice.
And if you don't need Arbitrary instances of other collection predicates, I'm okay with adding them later when they are needed