Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into series/0.10 #1000

Merged
merged 67 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7de38fd
Add inference for #917
kubukoz Mar 5, 2021
7935163
Some induction
kubukoz Mar 5, 2021
a5012ec
Simplified one inference + Enhanced naming + scala 3.0
matwojcik Mar 10, 2021
ea46a0a
Fixed ordering of implicits
matwojcik Mar 10, 2021
758d3ff
Merge pull request #927 from matwojcik/feature-917-inference
fthomas May 19, 2021
f2e3782
Update sbt-scoverage to 1.8.1
scala-steward May 19, 2021
842c3f5
Merge pull request #974 from scala-steward/update/sbt-scoverage-1.8.1
mergify[bot] May 19, 2021
1bc81cd
Update scala-compiler, scala-library, ... to 2.13.6 (#970)
scala-steward May 20, 2021
5203656
Update .mergify.yml
fthomas May 20, 2021
c3af254
Update sbt-github-actions to 0.11.0
scala-steward May 24, 2021
c2ed5c8
Regenerate workflow with sbt-github-actions
scala-steward May 24, 2021
7ea4bff
Merge pull request #975 from scala-steward/update/sbt-github-actions-…
fthomas May 24, 2021
9e7fc85
Update sbt-mima-plugin to 0.9.2
scala-steward May 26, 2021
75682f4
Merge pull request #976 from scala-steward/update/sbt-mima-plugin-0.9.2
mergify[bot] May 26, 2021
68fb928
Setting version to 0.9.26
fthomas May 26, 2021
6fbda86
Set 0.9.26 as latestVersion
fthomas May 26, 2021
d684e92
Update sbt-scoverage to 1.8.2
scala-steward May 28, 2021
afe28b2
Merge pull request #979 from scala-steward/update/sbt-scoverage-1.8.2
mergify[bot] May 28, 2021
ca3dac2
Update sbt to 1.5.3
scala-steward Jun 1, 2021
80570c4
Regenerate workflow with sbt-github-actions
scala-steward Jun 1, 2021
2777d52
Update sbt-jmh to 0.4.3
scala-steward Jun 1, 2021
dbb6dcc
Merge pull request #981 from scala-steward/update/sbt-jmh-0.4.3
mergify[bot] Jun 1, 2021
f57322f
Merge branch 'master' into update/sbt-1.5.3
scala-steward Jun 1, 2021
79b29be
Update sbt-github-actions to 0.12.0
scala-steward Jun 1, 2021
873cae4
Regenerate workflow with sbt-github-actions
scala-steward Jun 1, 2021
aa49967
Merge pull request #982 from scala-steward/update/sbt-github-actions-…
fthomas Jun 4, 2021
03a492f
Merge pull request #980 from scala-steward/update/sbt-1.5.3
fthomas Jun 4, 2021
1027d39
Update scala-compiler, scala-library, ... to 2.12.14 (#978)
scala-steward Jun 4, 2021
e3e37f8
Update sbt-scalajs, scalajs-library, ... to 1.6.0
scala-steward Jun 8, 2021
956c981
Merge pull request #984 from scala-steward/update/sbt-scalajs-1.6.0
fthomas Jun 8, 2021
7dde907
Update pureconfig-core, ... to 0.16.0
scala-steward Jun 10, 2021
7b25676
Merge pull request #985 from scala-steward/update/pureconfig-core-0.16.0
fthomas Jun 10, 2021
038caab
Add infix operator to refined and boolean types
Jun 11, 2021
c796c1e
Merge pull request #986 from qwbarch/master
fthomas Jun 12, 2021
707f621
Update sbt to 1.5.4
scala-steward Jun 14, 2021
7b3b3e6
Merge pull request #987 from scala-steward/update/sbt-1.5.4
mergify[bot] Jun 14, 2021
2a4938c
Update sbt-scala-native-crossproject, ... to 1.1.0
scala-steward Jul 3, 2021
f03d9c4
Merge pull request #989 from scala-steward/update/sbt-scala-native-cr…
fthomas Jul 3, 2021
868d481
Update scalaz-core to 7.3.4
scala-steward Jul 8, 2021
ad169c1
Merge pull request #991 from scala-steward/update/scalaz-core-7.3.4
mergify[bot] Jul 8, 2021
14a10d4
Update sbt-scalafmt to 2.4.3
scala-steward Jul 9, 2021
e0dab87
Merge pull request #992 from scala-steward/update/sbt-scalafmt-2.4.3
mergify[bot] Jul 9, 2021
09acccd
Update scala3-library, ... to 3.0.1
scala-steward Jul 9, 2021
6f89748
Regenerate workflow with sbt-github-actions
scala-steward Jul 9, 2021
9fd6dc7
Merge pull request #993 from scala-steward/update/scala3-library-3.0.1
fthomas Jul 9, 2021
16d5a9d
Update .mergify.yml
fthomas Jul 9, 2021
f25f46e
Move inferences to lower level of implicits, fixes #990
matwojcik Jul 9, 2021
a99a74d
Compilation fix
matwojcik Jul 9, 2021
64271a7
Fix Scala 2.12
matwojcik Jul 9, 2021
25f9383
Update sbt to 1.5.5
scala-steward Jul 12, 2021
98aff1d
Merge pull request #995 from scala-steward/update/sbt-1.5.5
mergify[bot] Jul 12, 2021
0dfb19e
Merge pull request #994 from matwojcik/990-fix
fthomas Jul 19, 2021
338fd5e
Setting version to 0.9.27
fthomas Jul 20, 2021
a9c4513
Set 0.9.27 as latestVersion
fthomas Jul 20, 2021
129e9cf
Update json-path to 2.6.0 (#983)
scala-steward Jul 20, 2021
60d768e
Update Scaladex badge on ReadMe to show Scala version support
rtyley Jul 20, 2021
f7af133
Merge pull request #996 from rtyley/patch-2
fthomas Jul 22, 2021
01c5220
Update scala-xml to 2.0.1 (#997)
scala-steward Jul 22, 2021
541489a
Move collection to scala-3.0{+,-} to simplify the diff to series/0.10
fthomas Jul 27, 2021
56b54f4
Merge pull request #999 from fthomas/topic/split-collection
fthomas Jul 27, 2021
1699c03
Merge branch 'master' into topic/merge-master-into-0.10
fthomas Jul 27, 2021
3e40781
Update ci.yml
fthomas Jul 27, 2021
07c9436
Remove xmlNonEmptyInference
fthomas Jul 27, 2021
afde929
Auto-refining literals does not work with Scala 3
fthomas Jul 27, 2021
371374f
Set libraryDependencySchemes in scalaxml module
fthomas Jul 27, 2021
28574e5
More MiMa exclusions
fthomas Jul 27, 2021
30d667e
Remove test
fthomas Jul 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['*']
branches: ['**']
push:
branches: ['*']
branches: ['**']
tags: [v*]

env:
Expand All @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.13, 2.13.5, 3.0.0]
scala: [2.12.14, 2.13.6, 3.0.1]
java: [[email protected]]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
uses: olafurpg/setup-scala@v12
with:
java-version: ${{ matrix.java }}

Expand All @@ -50,21 +50,21 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck'

- name: Build project (Scala 2)
if: matrix.scala == '2.12.13' || matrix.scala == '2.13.5'
run: sbt ++${{ matrix.scala }} validateJVM validateJS
if: matrix.scala == '2.12.14' || matrix.scala == '2.13.6'
run: sbt --client '++${{ matrix.scala }}; validateJVM; validateJS'

- name: Build project (Scala 3)
if: matrix.scala == '3.0.0'
run: sbt ++${{ matrix.scala }} validateJVM30 validateJS30
if: matrix.scala == '3.0.1'
run: sbt --client '++${{ matrix.scala }}; validateJVM30; validateJS30'

- name: Codecov
uses: codecov/codecov-action@v1

- name: Compress target directories
run: tar cf targets.tar modules/jsonpath/jvm/target modules/shapeless/js/target target modules/docs/target modules/pureconfig/jvm/target modules/core/js/target modules/core/jvm/target modules/scodec/jvm/target modules/scodec/js/target modules/shapeless/jvm/target modules/cats/js/target modules/cats/jvm/target modules/eval/jvm/target modules/scopt/jvm/target modules/scalaz/jvm/target modules/scalacheck/jvm/target modules/scalacheck/js/target modules/benchmark/target project/target
run: tar cf targets.tar modules/jsonpath/jvm/target modules/shapeless/js/target target modules/scalaxml/jvm/target modules/docs/target modules/pureconfig/jvm/target modules/core/js/target modules/core/jvm/target modules/scodec/jvm/target modules/scodec/js/target modules/shapeless/jvm/target modules/cats/js/target modules/cats/jvm/target modules/eval/jvm/target modules/scopt/jvm/target modules/scalaz/jvm/target modules/scalacheck/jvm/target modules/scalacheck/js/target modules/benchmark/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
Expand All @@ -79,7 +79,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.13]
scala: [2.12.14]
java: [[email protected]]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -89,7 +89,7 @@ jobs:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
uses: olafurpg/setup-scala@v12
with:
java-version: ${{ matrix.java }}

Expand All @@ -105,32 +105,32 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.13)
- name: Download target directories (2.12.14)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }}
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}

- name: Inflate target directories (2.12.13)
- name: Inflate target directories (2.12.14)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.5)
- name: Download target directories (2.13.6)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-2.13.5-${{ matrix.java }}
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}

- name: Inflate target directories (2.13.5)
- name: Inflate target directories (2.13.6)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.0.0)
- name: Download target directories (3.0.1)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-3.0.0-${{ matrix.java }}
name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }}

- name: Inflate target directories (3.0.0)
- name: Inflate target directories (3.0.1)
run: |
tar xf targets.tar
rm targets.tar
Expand Down
6 changes: 3 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ pull_request_rules:
- name: automatically merge scala-steward's PRs
conditions:
- author=scala-steward
- status-success=Build and Test (ubuntu-latest, 2.12.13, [email protected])
- status-success=Build and Test (ubuntu-latest, 2.13.5, [email protected])
- status-success=Build and Test (ubuntu-latest, 3.0.0, [email protected])
- status-success=Build and Test (ubuntu-latest, 2.12.14, [email protected])
- status-success=Build and Test (ubuntu-latest, 2.13.6, [email protected])
- status-success=Build and Test (ubuntu-latest, 3.0.1, [email protected])
- body~=labels:.*semver-patch
actions:
merge:
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/fthomas/refined/Continuous%20Integration)](https://github.com/fthomas/refined/actions?query=workflow%3A%22Continuous+Integration%22)
[![codecov.io](https://img.shields.io/codecov/c/github/fthomas/refined.svg)](http://codecov.io/github/fthomas/refined)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fthomas/refined?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Scaladex](https://index.scala-lang.org/fthomas/refined/refined/latest.svg?color=blue)](https://index.scala-lang.org/fthomas/refined/refined)
[![Scaladoc](https://www.javadoc.io/badge/eu.timepit/refined_2.12.svg?color=blue&label=Scaladoc)](https://javadoc.io/doc/eu.timepit/refined_2.12/0.9.25)
[![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)
[![Scaladoc](https://www.javadoc.io/badge/eu.timepit/refined_2.12.svg?color=blue&label=Scaladoc)](https://javadoc.io/doc/eu.timepit/refined_2.12/0.9.27)

**refined** is a Scala library for refining types with type-level predicates
which constrain the set of values described by the refined type.
Expand Down Expand Up @@ -89,7 +89,7 @@ scala> val b: Int Refined Greater[W.`4`.T] = a
b: Int Refined Greater[Int(4)] = 10
```

**Note** that [`W`](https://static.javadoc.io/eu.timepit/refined_2.12/0.9.25/eu/timepit/refined/index.html#W:shapeless.Witness.type)
**Note** that [`W`](https://static.javadoc.io/eu.timepit/refined_2.12/0.9.27/eu/timepit/refined/index.html#W:shapeless.Witness.type)
is a shortcut for [`shapeless.Witness`][singleton-types] which provides
syntax for [literal-based singleton types][sip-23].

Expand Down Expand Up @@ -187,31 +187,31 @@ ageEither2: Either[String,Age] = Right(55)

## Using refined

The latest version of the library is 0.9.25, which is available for Scala and
The latest version of the library is 0.9.27, which is available for Scala and
[Scala.js][scala.js] version 2.12 and 2.13.

If you're using sbt, add the following to your build:

```sbt
libraryDependencies ++= Seq(
"eu.timepit" %% "refined" % "0.9.25",
"eu.timepit" %% "refined-cats" % "0.9.25", // optional
"eu.timepit" %% "refined-eval" % "0.9.25", // optional, JVM-only
"eu.timepit" %% "refined-jsonpath" % "0.9.25", // optional, JVM-only
"eu.timepit" %% "refined-pureconfig" % "0.9.25", // optional, JVM-only
"eu.timepit" %% "refined-scalacheck" % "0.9.25", // optional
"eu.timepit" %% "refined-scalaz" % "0.9.25", // optional
"eu.timepit" %% "refined-scodec" % "0.9.25", // optional
"eu.timepit" %% "refined-scopt" % "0.9.25", // optional
"eu.timepit" %% "refined-shapeless" % "0.9.25" // optional
"eu.timepit" %% "refined" % "0.9.27",
"eu.timepit" %% "refined-cats" % "0.9.27", // optional
"eu.timepit" %% "refined-eval" % "0.9.27", // optional, JVM-only
"eu.timepit" %% "refined-jsonpath" % "0.9.27", // optional, JVM-only
"eu.timepit" %% "refined-pureconfig" % "0.9.27", // optional, JVM-only
"eu.timepit" %% "refined-scalacheck" % "0.9.27", // optional
"eu.timepit" %% "refined-scalaz" % "0.9.27", // optional
"eu.timepit" %% "refined-scodec" % "0.9.27", // optional
"eu.timepit" %% "refined-scopt" % "0.9.27", // optional
"eu.timepit" %% "refined-shapeless" % "0.9.27" // optional
)
```

For Scala.js just replace `%%` with `%%%` above.

Instructions for Maven and other build tools are available at [search.maven.org][search.maven].

Release notes for the latest version are [here](https://github.com/fthomas/refined/releases/tag/v0.9.25).
Release notes for the latest version are [here](https://github.com/fthomas/refined/releases/tag/v0.9.27).

## Community

Expand Down Expand Up @@ -308,7 +308,7 @@ opening a pull request to list it here:
## Documentation

API documentation of the latest release is available at:
<https://static.javadoc.io/eu.timepit/refined_2.12/0.9.25/eu/timepit/refined/index.html>
<https://static.javadoc.io/eu.timepit/refined_2.12/0.9.27/eu/timepit/refined/index.html>

There are further (type-checked) examples in the [`docs`][docs]
directory including ones for defining [custom predicates][custom-pred]
Expand Down
69 changes: 30 additions & 39 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ val gitHubOwner = "fthomas"
val gitPubUrl = s"https://github.com/$gitHubOwner/$projectName.git"
val gitDevUrl = s"[email protected]:$gitHubOwner/$projectName.git"

val Scala_2_12 = "2.12.13"
val Scala_2_13 = "2.13.5"
val Scala_3 = "3.0.0"
val Scala_2_12 = "2.12.14"
val Scala_2_13 = "2.13.6"
val Scala_3 = "3.0.1"

val catsVersion = "2.6.1"
val jsonpathVersion = "2.4.0"
val jsonpathVersion = "2.6.0"
val macroParadiseVersion = "2.1.1"
val pureconfigVersion = "0.15.0"
val pureconfigVersion = "0.16.0"
val shapelessVersion = "2.3.7"
val scalaCheckVersion = "1.15.4"
val scalaXmlVersion = "2.0.0"
val scalazVersion = "7.3.3"
val scalazVersion = "7.3.4"
val scodecVersion = "1.11.8"
val scoptVersion = "4.0.1"

Expand Down Expand Up @@ -290,7 +290,8 @@ lazy val shapelessJS = shapeless.js
lazy val scalaxml = myCrossProject("scalaxml")
.dependsOn(core % "compile->compile;test->test")
.settings(
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % scalaXmlVersion
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % scalaXmlVersion,
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always"
)

lazy val scalaxmlJVM = scalaxml.jvm
Expand Down Expand Up @@ -364,39 +365,29 @@ def moduleJvmSettings(name: String): Seq[Def.Setting[_]] =
},
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters.exclude
Seq(
ProblemFilters.exclude[DirectMissingMethodProblem](
"eu.timepit.refined.api.RefType.unsafeWrapM"
),
ProblemFilters.exclude[DirectMissingMethodProblem](
"eu.timepit.refined.api.RefType.unsafeRewrapM"
),
ProblemFilters.exclude[DirectMissingMethodProblem](
"eu.timepit.refined.api.RefType.refineMF"
),
ProblemFilters.exclude[MissingClassProblem](
"eu.timepit.refined.internal.RefineMFullyApplied"
),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$ConstructorNames"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$ConstructorNames$"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$FieldNames"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$FieldNames$"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$Subtype"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$Subtype$"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$Supertype"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.generic$Supertype$"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.string$Xml$"),
ProblemFilters.exclude[MissingClassProblem]("eu.timepit.refined.string$Xml"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"eu.timepit.refined.predicates.StringPredicates.Xml"
),
ProblemFilters.exclude[DirectMissingMethodProblem]("eu.timepit.refined.predicates.all.Xml"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"eu.timepit.refined.predicates.string.Xml"
),
ProblemFilters.exclude[DirectMissingMethodProblem]("eu.timepit.refined.util.string.xml"),
ProblemFilters.exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.Max.findValid"),
ProblemFilters.exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.Min.findValid")
exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.Max.findValid"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.Min.findValid"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.RefType.unsafeWrapM"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.RefType.unsafeRewrapM"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.api.RefType.refineMF"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.predicates.StringPredicates.Xml"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.predicates.all.Xml"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.predicates.string.Xml"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.string.xmlNonEmptyInference"),
exclude[DirectMissingMethodProblem]("eu.timepit.refined.util.string.xml"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$ConstructorNames"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$ConstructorNames$"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$FieldNames"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$FieldNames$"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$Subtype"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$Subtype$"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$Supertype"),
exclude[MissingClassProblem]("eu.timepit.refined.generic$Supertype$"),
exclude[MissingClassProblem]("eu.timepit.refined.internal.RefineMFullyApplied"),
exclude[MissingClassProblem]("eu.timepit.refined.string$Xml$"),
exclude[MissingClassProblem]("eu.timepit.refined.string$Xml")
)
}
)
Expand Down
8 changes: 6 additions & 2 deletions latestVersion.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ ThisBuild / bincompatVersions := Map(
"0.9.22",
"0.9.23",
"0.9.24",
"0.9.25"
"0.9.25",
"0.9.26",
"0.9.27"
// NEXT_VERSION
),
"2.13" -> Set(
Expand All @@ -41,7 +43,9 @@ ThisBuild / bincompatVersions := Map(
"0.9.22",
"0.9.23",
"0.9.24",
"0.9.25"
"0.9.25",
"0.9.26",
"0.9.27"
// NEXT_VERSION
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package eu.timepit.refined.api

opaque type Refined[T, P] = T
infix opaque type Refined[T, P] = T

object Refined {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ object boolean extends BooleanInference0 {
final case class Not[P](p: P)

/** Conjunction of the predicates `A` and `B`. */
final case class And[A, B](a: A, b: B)
infix final case class And[A, B](a: A, b: B)

/** Disjunction of the predicates `A` and `B`. */
final case class Or[A, B](a: A, b: B)
infix final case class Or[A, B](a: A, b: B)

/** Exclusive disjunction of the predicates `A` and `B`. */
final case class Xor[A, B](a: A, b: B)
infix final case class Xor[A, B](a: A, b: B)

/** Conjunction of all predicates in `PS`. */
final case class AllOf[PS](ps: PS)
Expand All @@ -37,10 +37,10 @@ object boolean extends BooleanInference0 {
final case class OneOf[PS](ps: PS)

/** Negated conjunction of the predicates `A` and `B`. */
type Nand[A, B] = Not[A And B]
infix type Nand[A, B] = Not[A And B]

/** Negated disjunction of the predicates `A` and `B`. */
type Nor[A, B] = Not[A Or B]
infix type Nor[A, B] = Not[A Or B]

object True {
implicit def trueValidate[T]: Validate.Plain[T, True] =
Expand Down Expand Up @@ -282,11 +282,23 @@ private[refined] trait BooleanInference1 extends BooleanInference2 {
p1.adapt("modusTollens(%s)")
}

private[refined] trait BooleanInference2 {
private[refined] trait BooleanInference2 extends BooleanInference3 {

implicit def conjunctionEliminationL[A, B, C](implicit p1: A ==> C): (A And B) ==> C =
p1.adapt("conjunctionEliminationL(%s)")

implicit def hypotheticalSyllogism[A, B, C](implicit p1: A ==> B, p2: B ==> C): A ==> C =
Inference.combine(p1, p2, "hypotheticalSyllogism(%s, %s)")
}

private[refined] trait BooleanInference3 {

implicit def substitutionInConjunction[A, B, C](implicit p1: B ==> C): (A And B) ==> (A And C) =
p1.adapt("substitutionInConjunction(%s)")

implicit def disjunctionTautologyElimination[A, B, C](implicit
p1: A ==> C,
p2: B ==> C
): (A Or B) ==> C =
Inference.combine(p1, p2, "disjunctionElimination")
}
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ private[refined] trait StringInference {
implicit def validBigDecimalNonEmptyInference: ValidBigDecimal ==> NonEmpty =
Inference.alwaysValid("validBigDecimalNonEmptyInference")

implicit def xmlNonEmptyInference: Xml ==> NonEmpty =
Inference.alwaysValid("xmlNonEmptyInference")

implicit def xPathNonEmptyInference: XPath ==> NonEmpty =
Inference.alwaysValid("xPathNonEmptyInference")
}
Loading