{"id":13682747,"url":"https://github.com/fthomas/refined","last_synced_at":"2025-05-13T21:12:23.346Z","repository":{"id":31811892,"uuid":"35378524","full_name":"fthomas/refined","owner":"fthomas","description":"Refinement types for Scala","archived":false,"fork":false,"pushed_at":"2025-05-06T16:32:09.000Z","size":3755,"stargazers_count":1723,"open_issues_count":73,"forks_count":153,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-06T17:42:29.236Z","etag":null,"topics":["refinement-types","scala","typelevel"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fthomas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-05-10T16:23:16.000Z","updated_at":"2025-05-06T16:32:13.000Z","dependencies_parsed_at":"2023-09-26T19:59:11.532Z","dependency_job_id":"cf06d8b2-e652-47b8-9cd8-333dcf49b6fd","html_url":"https://github.com/fthomas/refined","commit_stats":{"total_commits":2323,"total_committers":84,"mean_commits":"27.654761904761905","dds":"0.41239776151528196","last_synced_commit":"b62a32a40f9e2f52acf33cd9e1d3261de663e39e"},"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fthomas%2Frefined","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fthomas%2Frefined/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fthomas%2Frefined/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fthomas%2Frefined/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fthomas","download_url":"https://codeload.github.com/fthomas/refined/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029008,"owners_count":22002284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["refinement-types","scala","typelevel"],"created_at":"2024-08-02T13:01:52.506Z","updated_at":"2025-05-13T21:12:18.333Z","avatar_url":"https://github.com/fthomas.png","language":"Scala","readme":"# refined: simple refinement types for Scala\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fthomas/refined/ci.yml)](https://github.com/fthomas/refined/actions/workflows/ci.yml)\n[![codecov.io](https://img.shields.io/codecov/c/github/fthomas/refined.svg)](http://codecov.io/github/fthomas/refined)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fthomas/refined?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![refined Scala version support](https://index.scala-lang.org/fthomas/refined/refined/latest-by-scala-version.svg?color=blue)](https://index.scala-lang.org/fthomas/refined/refined)\n[![Scaladoc](https://www.javadoc.io/badge/eu.timepit/refined_2.12.svg?color=blue\u0026label=Scaladoc)](https://javadoc.io/doc/eu.timepit/refined_2.12/0.11.3)\n\n**refined** is a Scala library for refining types with type-level predicates\nwhich constrain the set of values described by the refined type.\nIt started as a port of the [refined][refined.hs] Haskell library by\n[Nikita Volkov](https://github.com/nikita-volkov) (which also provides an excellent\nmotivation why this kind of library is useful).\nThe idea of expressing constraints at the type-level as Scala library was first\nexplored by [Flavio W. Brasil](https://github.com/fwbrasil) in [bond][bond].\n\nA quick example:\n\n```scala\nimport eu.timepit.refined._\nimport eu.timepit.refined.api.Refined\nimport eu.timepit.refined.auto._\nimport eu.timepit.refined.numeric._\n\n// This refines Int with the Positive predicate and checks via an\n// implicit macro that the assigned value satisfies it:\nscala\u003e val i1: Int Refined Positive = 5\ni1: Int Refined Positive = 5\n\n// If the value does not satisfy the predicate, we get a meaningful\n// compile error:\nscala\u003e val i2: Int Refined Positive = -5\n\u003cconsole\u003e:22: error: Predicate failed: (-5 \u003e 0).\n       val i2: Int Refined Positive = -5\n                                       ^\n\n// There is also the explicit refineMV macro that can infer the base\n// type from its parameter:\nscala\u003e refineMV[Positive](5)\nres0: Int Refined Positive = 5\n\n// Macros can only validate literals because their values are known at\n// compile-time. To validate arbitrary (runtime) values we can use the\n// refineV function:\n\nscala\u003e val x = 42 // suppose the value of x is not known at compile-time\n\nscala\u003e refineV[Positive](x)\nres1: Either[String, Int Refined Positive] = Right(42)\n\nscala\u003e refineV[Positive](-x)\nres2: Either[String, Int Refined Positive] = Left(Predicate failed: (-42 \u003e 0).)\n```\n\n**refined** also contains inference rules for converting between different\nrefined types. For example, ``Int Refined Greater[10]`` can be safely\nconverted to `Int Refined Positive` because all integers greater than ten\nare also positive. The type conversion of refined types is a compile-time\noperation that is provided by the library:\n\n```scala\nscala\u003e val a: Int Refined Greater[5] = 10\na: Int Refined Greater[Int(5)] = 10\n\n// Since every value greater than 5 is also greater than 4, `a` can be\n// ascribed the type Int Refined Greater[4]:\nscala\u003e val b: Int Refined Greater[4] = a\nb: Int Refined Greater[Int(4)] = 10\n\n// An unsound ascription leads to a compile error:\nscala\u003e val c: Int Refined Greater[6] = a\n                                       ^\n       error: type mismatch (invalid inference):\n               eu.timepit.refined.numeric.Greater[5] does not imply\n               eu.timepit.refined.numeric.Greater[6]\n```\n\nThis mechanism allows to pass values of more specific types (e.g.\n``Int Refined Greater[10]``) to functions that take a more general\ntype (e.g. `Int Refined Positive`) without manual intervention.\n\n### prior Scala 2.13 without literal types\n\nSince there are no literal types prior to Scala 2.13 the literals must be created with shapeless:\n\n```scala\nscala\u003e val a: Int Refined Greater[W.`5`.T] = 10\na: Int Refined Greater[Int(5)] = 10\nscala\u003e val b: Int Refined Greater[W.`4`.T] = a\nb: Int Refined Greater[Int(4)] = 10\n```\n\n**Note** that [`W`](https://static.javadoc.io/eu.timepit/refined_2.12/0.11.3/eu/timepit/refined/index.html#W:shapeless.Witness.type)\nis a shortcut for [`shapeless.Witness`][singleton-types] which provides\nsyntax for [literal-based singleton types][sip-23].\n\n## Table of contents\n\n1. [More examples](#more-examples)\n2. [Using refined](#using-refined)\n3. [Community](#community)\n4. [Documentation](#documentation)\n5. [Provided predicates](#provided-predicates)\n6. [Contributors and participation](#contributors-and-participation)\n7. [Related projects](#related-projects)\n8. [License](#license)\n\n## More examples\n\n```scala\nimport eu.timepit.refined._\nimport eu.timepit.refined.auto._\nimport eu.timepit.refined.numeric._\nimport eu.timepit.refined.api.{RefType, Refined}\nimport eu.timepit.refined.boolean._\nimport eu.timepit.refined.char._\nimport eu.timepit.refined.collection._\nimport eu.timepit.refined.generic._\nimport eu.timepit.refined.string._\nimport shapeless.{ ::, HNil }\n\nscala\u003e refineMV[NonEmpty](\"Hello\")\nres2: String Refined NonEmpty = Hello\n\nscala\u003e refineMV[NonEmpty](\"\")\n\u003cconsole\u003e:39: error: Predicate isEmpty() did not fail.\n            refineMV[NonEmpty](\"\")\n                              ^\n\nscala\u003e type ZeroToOne = Not[Less[0.0]] And Not[Greater[1.0]]\ndefined type alias ZeroToOne\n\nscala\u003e refineMV[ZeroToOne](1.8)\n\u003cconsole\u003e:40: error: Right predicate of (!(1.8 \u003c 0.0) \u0026\u0026 !(1.8 \u003e 1.0)) failed: Predicate (1.8 \u003e 1.0) did not fail.\n       refineMV[ZeroToOne](1.8)\n                          ^\n\nscala\u003e refineMV[AnyOf[Digit :: Letter :: Whitespace :: HNil]]('F')\nres3: Char Refined AnyOf[Digit :: Letter :: Whitespace :: HNil] = F\n\nscala\u003e refineMV[MatchesRegex[\"[0-9]+\"]](\"123.\")\n\u003cconsole\u003e:39: error: Predicate failed: \"123.\".matches(\"[0-9]+\").\n              refineMV[MatchesRegex[W.`\"[0-9]+\"`.T]](\"123.\")\n                                                    ^\n\nscala\u003e val d1: Char Refined Equal['3'] = '3'\nd1: Char Refined Equal[Char('3')] = 3\n\nscala\u003e val d2: Char Refined Digit = d1\nd2: Char Refined Digit = 3\n\nscala\u003e val d3: Char Refined Letter = d1\n\u003cconsole\u003e:39: error: type mismatch (invalid inference):\n Equal[Char('3')] does not imply\n Letter\n       val d3: Char Refined Letter = d1\n                                     ^\n\nscala\u003e val r1: String Refined Regex = \"(a|b)\"\nr1: String Refined Regex = (a|b)\n\nscala\u003e val r2: String Refined Regex = \"(a|b\"\n\u003cconsole\u003e:38: error: Regex predicate failed: Unclosed group near index 4\n(a|b\n    ^\n       val r2: String Refined Regex = \"(a|b\"\n                                      ^\n\nscala\u003e val u1: String Refined Url = \"htp://example.com\"\n\u003cconsole\u003e:38: error: Url predicate failed: unknown protocol: htp\n       val u1: String Refined Url = \"htp://example.com\"\n                                    ^\n\n// Here we define a refined type \"Int with the predicate (7 \u003c= value \u003c 77)\".\nscala\u003e type Age = Int Refined Interval.ClosedOpen[7, 77]\n\nscala\u003e val userInput = 55\n\n// We can refine values with this refined type by either using `refineV`\n// with an explicit return type\nscala\u003e val ageEither1: Either[String, Age] = refineV(userInput)\nageEither1: Either[String,Age] = Right(55)\n\n// or by using `RefType.applyRef` with the refined type as type parameter.\nscala\u003e val ageEither2 = RefType.applyRef[Age](userInput)\nageEither2: Either[String,Age] = Right(55)\n```\n\n## Using refined\n\nThe latest version of the library is 0.11.3, which is available for Scala and\n[Scala.js][scala.js] version 2.12 and 2.13.\n\nIf you're using sbt, add the following to your build:\n\n```sbt\nlibraryDependencies ++= Seq(\n  \"eu.timepit\" %% \"refined\"                 % \"0.11.3\",\n  \"eu.timepit\" %% \"refined-cats\"            % \"0.11.3\", // optional\n  \"eu.timepit\" %% \"refined-eval\"            % \"0.11.3\", // optional, JVM-only\n  \"eu.timepit\" %% \"refined-jsonpath\"        % \"0.11.3\", // optional, JVM-only\n  \"eu.timepit\" %% \"refined-pureconfig\"      % \"0.11.3\", // optional, JVM-only\n  \"eu.timepit\" %% \"refined-scalacheck\"      % \"0.11.3\", // optional\n  \"eu.timepit\" %% \"refined-scalaz\"          % \"0.11.3\", // optional\n  \"eu.timepit\" %% \"refined-scodec\"          % \"0.11.3\", // optional\n  \"eu.timepit\" %% \"refined-scopt\"           % \"0.11.3\", // optional\n  \"eu.timepit\" %% \"refined-shapeless\"       % \"0.11.3\"  // optional\n)\n```\n\nFor Scala.js just replace `%%` with `%%%` above.\n\nInstructions for Maven and other build tools are available at [search.maven.org][search.maven].\n\nRelease notes for the latest version are [here](https://github.com/fthomas/refined/releases/tag/v0.11.3).\n\n## Community\n\n### Internal modules\n\nThe project provides these optional extensions and library integrations:\n\n* `refined-cats` provides [Cats](https://github.com/typelevel/cats)\n  type class instances for refined types\n* `refined-eval` provides the `Eval[S]` predicate that checks if a value\n  applied to the predicate `S` yields `true`\n* `refined-jsonpath` provides the `JSONPath` predicate that checks if a\n  `String` is a valid [JSONPath](http://goessner.net/articles/JsonPath/)\n* `refined-pureconfig` allows to read configuration with refined types\n  using [PureConfig](https://github.com/pureconfig/pureconfig)\n* `refined-scalacheck` allows to generate arbitrary values of refined types\n  with [ScalaCheck](http://scalacheck.org/).\n  Use `refined-scalacheck_1.13` instead if your other dependencies\n  use scalacheck version 1.13\n* `refined-scalaz` provides [Scalaz](https://github.com/scalaz/scalaz)\n  type class instances for refined types and support for `scalaz.@@`\n* `refined-scodec` allows binary decoding and encoding of refined types with\n  [scodec](http://scodec.org/) and allows refining `scodec.bits.ByteVector`\n* `refined-scopt` allows to read command line options with refined types\n  using [scopt](https://github.com/scopt/scopt)\n* `refined-shapeless`\n\n### External modules\n\nBelow is an incomplete list of third-party extensions and library integrations\nfor **refined**. If your library is missing, please open a pull request to\nlist it here:\n\n* [api-refiner](https://github.com/dgouyette/play-api-refiner)\n* [argonaut-refined](https://github.com/alexarchambault/argonaut-shapeless)\n* [atto-refined](https://github.com/tpolecat/atto)\n* [case-app-refined](https://github.com/alexarchambault/case-app)\n* [circe-refined](https://github.com/circe/circe)\n* [ciris-refined](https://github.com/vlovgr/ciris)\n* [cormorant-refined](https://github.com/ChristopherDavenport/cormorant)\n* [coulomb-refined](https://github.com/erikerlandson/coulomb/tree/develop/coulomb-refined)\n* [decline-refined](http://ben.kirw.in/decline/arguments.html#refined-support)\n* [doobie-refined](https://github.com/tpolecat/doobie)\n* [exercises-refined](https://github.com/ysusuk/exercises-refined)\n* [extruder-refined](https://github.com/janstenpickle/extruder)\n* [finch-refined](https://github.com/finagle/finch)\n* [formulation-refined](https://github.com/vectos/formulation)\n* [kantan.csv-refined](https://nrinaudo.github.io/kantan.csv/refined.html)\n* [kantan.regex-refined](https://nrinaudo.github.io/kantan.regex/refined.html)\n* [kantan.xpath-refined](https://nrinaudo.github.io/kantan.xpath/refined.html)\n* [monocle-refined](https://github.com/julien-truffaut/Monocle)\n* [neotypes-refined](https://github.com/neotypes/neotypes)\n* [play-refined](https://github.com/kwark/play-refined)\n* [play-json-refined](https://github.com/lunaryorn/play-json-refined)\n* [play-json-refined](https://github.com/btlines/play-json-refined)\n* [refined-anorm](https://github.com/derekmorr/refined-anorm)\n* [refined-guava](https://github.com/derekmorr/refined-guava)\n* [scanamo-refined](https://github.com/scanamo/scanamo)\n* [seals-refined](https://github.com/durban/seals)\n* [slick-refined](https://github.com/kwark/slick-refined)\n* [spray-json-refined](https://github.com/typeness/spray-json-refined)\n* [strictify-refined](https://github.com/cakesolutions/strictify)\n* [validated-config](https://github.com/carlpulley/validated-config)\n* [vulcan-refined](https://github.com/ovotech/vulcan)\n* [xml-names-core](https://github.com/slamdata/scala-xml-names)\n\n### Projects using refined\n\nIf your open source project is using **refined**, please consider opening\na pull request to list it here:\n\n* [calypso](https://github.com/m2-oss/calypso): BSON library for Scala\n* [Quasar](https://github.com/quasar-analytics/quasar): An open source\n  NoSQL analytics engine which uses refined for natural and positive\n  integer types\n* [rvi_sota_server](https://github.com/GENIVI/rvi_sota_server): The SOTA\n  Server Reference Implementation uses refined for domain specific types.\n  like the [vehicle identification number (VIN)](https://en.wikipedia.org/wiki/Vehicle_identification_number).\n\n### Adopters\n\nAre you using **refined** in your organization or company? Please consider\nopening a pull request to list it here:\n\n* [PITS Global Data Recovery Services](https://www.pitsdatarecovery.net/)\n* [AutoScout24](http://techblog.scout24.com/)\n* [Besedo](https://besedo.com/)\n* [Chatroulette](https://chatroulette.com/)\n* [Colisweb](https://www.colisweb.com/fr/)\n* [FOLIO](https://folio-sec.com/)\n* [HolidayCheck](http://techblog.holidaycheck.com/)\n* [Zalando](https://tech.zalando.de/)\n* [ContentSquare](https://contentsquare.com/)\n* [Dassault Systèmes](https://www.3ds.com/)\n* [Hypefactors](https://www.hypefactors.com/)\n\n## Documentation\n\nAPI documentation of the latest release is available at:\n\u003chttps://static.javadoc.io/eu.timepit/refined_2.12/0.11.3/eu/timepit/refined/index.html\u003e\n\nThere are further (type-checked) examples in the [`docs`][docs]\ndirectory including ones for defining [custom predicates][custom-pred]\nand working with [type aliases][type-aliases]. It also contains a\n[description][design] of **refined's** design and internals.\n\nTalks and other external resources are listed on the [Resources][resources]\npage in the wiki.\n\n[custom-pred]: https://github.com/fthomas/refined/blob/master/modules/docs/custom_predicates.md\n[design]: https://github.com/fthomas/refined/blob/master/modules/docs/design.md\n[docs]: https://github.com/fthomas/refined/tree/master/modules/docs\n[resources]: https://github.com/fthomas/refined/wiki/Resources\n[type-aliases]: https://github.com/fthomas/refined/blob/master/modules/docs/type_aliases.md\n\n## Provided predicates\n\nThe library comes with these predefined predicates:\n\n[`boolean`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/boolean.scala)\n\n* `True`: constant predicate that is always `true`\n* `False`: constant predicate that is always `false`\n* `Not[P]`: negation of the predicate `P`\n* `And[A, B]`: conjunction of the predicates `A` and `B`\n* `Or[A, B]`: disjunction of the predicates `A` and `B`\n* `Xor[A, B]`: exclusive disjunction of the predicates `A` and `B`\n* `Nand[A, B]`: negated conjunction of the predicates `A` and `B`\n* `Nor[A, B]`: negated disjunction of the predicates `A` and `B`\n* `AllOf[PS]`: conjunction of all predicates in `PS`\n* `AnyOf[PS]`: disjunction of all predicates in `PS`\n* `OneOf[PS]`: exclusive disjunction of all predicates in `PS`\n\n[`char`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala/eu/timepit/refined/char.scala)\n\n* `Digit`: checks if a `Char` is a digit\n* `Letter`: checks if a `Char` is a letter\n* `LetterOrDigit`: checks if a `Char` is a letter or digit\n* `LowerCase`: checks if a `Char` is a lower case character\n* `UpperCase`: checks if a `Char` is an upper case character\n* `Whitespace`: checks if a `Char` is white space\n\n[`collection`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/collection.scala)\n\n* `Contains[U]`: checks if an `Iterable` contains a value equal to `U`\n* `Count[PA, PC]`: counts the number of elements in an `Iterable` which satisfy the\n  predicate `PA` and passes the result to the predicate `PC`\n* `Empty`: checks if an `Iterable` is empty\n* `NonEmpty`: checks if an `Iterable` is not empty\n* `Forall[P]`: checks if the predicate `P` holds for all elements of an `Iterable`\n* `Exists[P]`: checks if the predicate `P` holds for some elements of an `Iterable`\n* `Head[P]`: checks if the predicate `P` holds for the first element of an `Iterable`\n* `Index[N, P]`: checks if the predicate `P` holds for the element at index `N` of a sequence\n* `Init[P]`: checks if the predicate `P` holds for all but the last element of an `Iterable`\n* `Last[P]`: checks if the predicate `P` holds for the last element of an `Iterable`\n* `Tail[P]`: checks if the predicate `P` holds for all but the first element of an `Iterable`\n* `Size[P]`: checks if the size of an `Iterable` satisfies the predicate `P`\n* `MinSize[N]`: checks if the size of an `Iterable` is greater than or equal to `N`\n* `MaxSize[N]`: checks if the size of an `Iterable` is less than or equal to `N`\n\n[`generic`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/generic.scala)\n\n* `Equal[U]`: checks if a value is equal to `U`\n\n[`numeric`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/numeric.scala)\n\n* `Less[N]`: checks if a numeric value is less than `N`\n* `LessEqual[N]`: checks if a numeric value is less than or equal to `N`\n* `Greater[N]`: checks if a numeric value is greater than `N`\n* `GreaterEqual[N]`: checks if a numeric value is greater than or equal to `N`\n* `Positive`: checks if a numeric value is greater than zero\n* `NonPositive`: checks if a numeric value is zero or negative\n* `Negative`: checks if a numeric value is less than zero\n* `NonNegative`: checks if a numeric value is zero or positive\n* `Interval.Open[L, H]`: checks if a numeric value is in the interval (`L`, `H`)\n* `Interval.OpenClosed[L, H]`: checks if a numeric value is in the interval (`L`, `H`]\n* `Interval.ClosedOpen[L, H]`: checks if a numeric value is in the interval [`L`, `H`)\n* `Interval.Closed[L, H]`: checks if a numeric value is in the interval [`L`, `H`]\n* `Modulo[N, O]`: checks if an integral value modulo `N` is `O`\n* `Divisible[N]`: checks if an integral value is evenly divisible by `N`\n* `NonDivisible[N]`: checks if an integral value is not evenly divisible by `N`\n* `Even`: checks if an integral value is evenly divisible by 2\n* `Odd`: checks if an integral value is not evenly divisible by 2\n* `NonNaN`: checks if a floating-point number is not NaN\n\n[`string`](https://github.com/fthomas/refined/blob/master/modules/core/shared/src/main/scala-3.0+/eu/timepit/refined/string.scala)\n\n* `EndsWith[S]`: checks if a `String` ends with the suffix `S`\n* `IPv4`: checks if a `String` is a valid IPv4\n* `IPv6`: checks if a `String` is a valid IPv6\n* `MatchesRegex[S]`: checks if a `String` matches the regular expression `S`\n* `Regex`: checks if a `String` is a valid regular expression\n* `StartsWith[S]`: checks if a `String` starts with the prefix `S`\n* `Uri`: checks if a `String` is a valid URI\n* `Url`: checks if a `String` is a valid URL\n* `Uuid`: checks if a `String` is a valid UUID\n* `ValidByte`: checks if a `String` is a parsable `Byte`\n* `ValidShort`: checks if a `String` is a parsable `Short`\n* `ValidInt`: checks if a `String` is a parsable `Int`\n* `ValidLong`: checks if a `String` is a parsable `Long`\n* `ValidFloat`: checks if a `String` is a parsable `Float`\n* `ValidDouble`: checks if a `String` is a parsable `Double`\n* `ValidBigInt`: checks if a `String` is a parsable `BigInt`\n* `ValidBigDecimal`: checks if a `String` is a parsable `BigDecimal`\n* `Xml`: checks if a `String` is well-formed XML\n* `XPath`: checks if a `String` is a valid XPath expression\n* `Trimmed`: checks if a `String` has no leading or trailing whitespace\n* `HexStringSpec`: checks if a `String` represents a hexadecimal number\n\n## Contributors and participation\n\nThe following people have helped making **refined** great:\n\n* [Alex](https://github.com/jhnsmth)\n* [Alexandre Archambault](https://github.com/alexarchambault)\n* [Arman Bilge](https://github.com/armanbilge)\n* [Brian P. Holt](https://github.com/bpholt)\n* [Chris Birchall](https://github.com/cb372)\n* [Chris Hodapp](https://github.com/clhodapp)\n* [Cody Allen](https://github.com/ceedubs)\n* [Dale Wijnand](https://github.com/dwijnand)\n* [Denys Shabalin](https://github.com/densh)\n* [Derek Morr](https://github.com/derekmorr)\n* [Didac](https://github.com/umbreak)\n* [Diogo Castro](https://github.com/dcastro)\n* [dm-tran](https://github.com/dm-tran)\n* [Ender Tunç](https://github.com/endertunc)\n* [Frank S. Thomas](https://github.com/fthomas)\n* [Frederick Roth](https://github.com/froth)\n* [Howard Perrin](https://github.com/howyp)\n* [Iurii Susuk](https://github.com/ysusuk)\n* [Ivan Klass](https://github.com/ivan-klass)\n* [Jean-Rémi Desjardins](https://github.com/jedesah)\n* [Jente Hidskes](https://github.com/Hjdskes)\n* [Joe Greene](https://github.com/ClydeMachine)\n* [John-Michael Reed](https://github.com/JohnReedLOL)\n* [Julien BENOIT](https://github.com/jbenoit2011)\n* [kalejami](https://github.com/kalejami)\n* [kenji yoshida](https://github.com/xuwei-k)\n* [kusamakura](https://github.com/kusamakura)\n* [急須](https://github.com/kyusu)\n* [Leif Wickland](https://github.com/leifwickland)\n* [Luis Miguel Mejía Suárez](https://github.com/BalmungSan)\n* [Mateusz Wójcik](https://github.com/matwojcik)\n* [Matt Pickering](https://github.com/matthedude)\n* [Matthieu Jacquot](https://github.com/err0r500)\n* [Michael Thomas](https://github.com/Michaelt293)\n* [Michal Sitko](https://github.com/note)\n* [Naoki Aoyama](https://github.com/aoiroaoino)\n* [Nicolas Rinaudo](https://github.com/nrinaudo)\n* [Olli Helenius](https://github.com/liff)\n* [Richard Gomes](https://github.com/frgomes)\n* [ronanM](https://github.com/ronanM)\n* [Sam Guymer](https://github.com/guymers)\n* [Sam Halliday](https://github.com/fommil)\n* [Shawn Garner](https://github.com/BusyByte)\n* [Shohei Shimomura](https://github.com/sh0hei)\n* [Shunsuke Otani](https://github.com/zaneli)\n* [Tim Steinbach](https://github.com/NeQuissimus)\n* [Torsten Scholak](https://github.com/tscholak)\n* [Viktor Lövgren](https://github.com/vlovgr)\n* [Vladimir Koshelev](https://github.com/koshelev)\n* [Yuki Ishikawa](https://github.com/rider-yi)\n* [Zainab Ali](https://github.com/zainab-ali)\n* Your name here :-)\n\n**refined** is a [Typelevel][typelevel] project. This means we embrace pure,\ntypeful, functional programming, and provide a safe and friendly environment\nfor teaching, learning, and contributing as described in the\n[Scala Code of Conduct](http://scala-lang.org/conduct.html).\n\n## Related projects\n\n* [SMT-Based Checking of Predicate-Qualified Types for Scala](http://lara.epfl.ch/~kuncak/papers/SchmidKuncak16CheckingPredicate.pdf)\n* [bond][bond]: Type-level validation for Scala\n* [F7](http://research.microsoft.com/en-us/projects/f7/): Refinement Types for F#\n* [LiquidHaskell](https://ucsd-progsys.github.io/liquidhaskell-blog/):\n  Refinement Types via SMT and Predicate Abstraction\n* [Refinement Types in Typed Racket](http://blog.racket-lang.org/2017/11/adding-refinement-types.html)\n* [refined][refined.hs]: Refinement types with static and runtime checking for\n  Haskell. **refined** was inspired by this library and even stole its name!\n* [refscript](https://github.com/UCSD-PL/refscript): Refinement Types for TypeScript\n* [Subtypes in Perl 6](https://design.perl6.org/S12.html#Types_and_Subtypes)\n\n## License\n\n**refined** is licensed under the MIT license, available at http://opensource.org/licenses/MIT\nand also in the [LICENSE](https://github.com/fthomas/refined/blob/master/LICENSE) file.\n\n[bond]: https://github.com/fwbrasil/bond\n[refined.hs]: http://nikita-volkov.github.io/refined\n[scala.js]: http://www.scala-js.org\n[search.maven]: http://search.maven.org/#search|ga|1|eu.timepit.refined\n[singleton-types]: https://github.com/milessabin/shapeless/wiki/Feature-overview:-shapeless-2.0.0#singleton-typed-literals\n[sip-23]: http://docs.scala-lang.org/sips/42.type.html\n[typelevel]: http://typelevel.org\n","funding_links":[],"categories":["Scala","Table of Contents","Extensions","\u003ca name=\"Scala\"\u003e\u003c/a\u003eScala"],"sub_categories":["Extensions"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffthomas%2Frefined","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffthomas%2Frefined","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffthomas%2Frefined/lists"}