refined
refined copied to clipboard
Refinement types for Scala
Would it be possible to have certain always-invalid or always-valid predicate compositions cause compilation errors? For example: ``` @ type InvalidSize = Size[Equal[W.`-9`.T]] defined type InvalidSize ``` or ``` @...
The title sucks, I know :) The following is an annoying thing `refined` allows but should probably not be allowed. I also think that some kind of type bound or...
In Scala.js (`addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")`, when I try to do something like: ```scala import eu.timepit.refined._ import eu.timepit.refined.api.Refined import eu.timepit.refined.auto._ import eu.timepit.refined.numeric._ type WidthRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]...
In #382 I expressed concerns about adding a variant of the `validate` method that doesn't require a full refined type, because I feel the current API surface is already quite...
Fixes #454 Here I've tried to have Inference as a trait and added 2 subtypes - InferAlways - InferWhen With that we can directly have a safe conversion whenever an...
Some people (myself among them) prefer the simplicity of a blanket import to enable standard functionality, along the lines of `import scalaz._; import Scalaz._`. As well as convenience and accessibility...
The predicates in refined are currently organized in objects (like `numeric`, `string`, etc.) in the `eu.timepit.refined` package. With the addition of predefined refined types in `eu.timepit.refined.types` the predicates became a...
I have a type defined as: ```type Some = String Refined MatchesRegex[W.`"[a-zA-Z_][a-zA-Z0-9-_.]*"`.T]``` and then I try to get this type back from a string: ``` //string is a val coming...
I have a (seemingly) unusual use-case with refined: I would like to define a combination of refinements. Here is a simple example: ```scala import eu.timepit.refined.predicates.all._ type Hostname = NonEmptyString type...
![image](https://user-images.githubusercontent.com/873919/39410509-1acf6474-4c02-11e8-805b-b85a880a0102.png)