refined icon indicating copy to clipboard operation
refined copied to clipboard

Refinement types for Scala

Results 80 refined issues
Sort by recently updated
recently updated
newest added

As discussed in #6, there is room for a `Sorted` predicate. I'm currently running into use cases where an algorithm's implementation differs for sorted and unsorted collections. If we can...

see https://github.com/alexarchambault/sonatype-stats

```scala scala> val d: Double Refined Interval.Closed[W.`5.0`.T, W.`15.0`.T] = Double.NaN d: eu.timepit.refined.api.Refined[Double,eu.timepit.refined.numeric.Interval.Closed[Double(5.0),Double(15.0)]] = NaN scala> val f: Float Refined Interval.Closed[W.`5.0f`.T, W.`15.0f`.T] = Float.NaN f: eu.timepit.refined.api.Refined[Float,eu.timepit.refined.numeric.Interval.Closed[Float(5.0),Float(15.0)]] = NaN ``` The only...

While getting familiar with `refined` (version `0.9.4`) I was excited by ability to easily convert between refined types: ```scala scala> val a: Int Refined Greater[W.`5`.T] = 10 a: Int Refined...

PureConfig provides an instance of `ConfigReader` for maps. (see https://github.com/pureconfig/pureconfig/blob/v0.9.0/core/src/main/scala/pureconfig/DerivedReaders.scala#L198) Unfortunately, it seems impossible to provide a refinement for the map key without writing a custom `ConfigReader` I think `refined`...

This tweet https://twitter.com/ppurang/status/674252856720031745 indicates that we could improve the error message when a value doesn't satisfy the predicate.

enhancement

It would be wonderful if we had a string refinement that validates an email address :)

``` type PositiveInt = Int Refined Positive type PositiveAndLessTenInt = Int Refined (Positive And Less[W.`10`.T]) var foo: PositiveInt = 1 val bar: PositiveAndLessTenInt = 5 foo = bar ``` This...

It would be cool if this worked: ```scala type NonEmptySeq[A] = immutable.Seq[A] Refined NonEmpty object NonEmptySeq { def apply[A]: RefinedTypeOps[NonEmptySeq[A], immutable.Seq[A]] = { new RefinedTypeOps[NonEmptySeq[A], immutable.Seq[A]] } } val a...

First let me apologize for creating an issue for a simple question, but I haven't found another channel. So, let's say I would like to refine `scala.concurrent.duration.FiniteDuration`, e.g. with `Positive`....