Skip to content

Commit

Permalink
Merge branch 'arrow-kt:main' into ja-increase-currying-test-coverage-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
lgtout authored Mar 8, 2023
2 parents 2aed7b4 + e94dc2e commit 98192dc
Show file tree
Hide file tree
Showing 57 changed files with 1,901 additions and 993 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-alpha-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
- 'auto'

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"

jobs:
check:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/githubpages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: githubpages

on:
push:
branches:
- main

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"

jobs:
githubpages:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Dokka
id: Dokka
run: ./gradlew cleanDocs dokkaHtmlMultiModule -Pgithubpages=true

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
BASEDIR: ${{github.workspace}}/arrow-libs
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Create API doc
uses: gradle/gradle-build-action@v2
with:
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true dokkaGfm
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true cleanDocs dokkaHtmlMultiModule

- name: Build release directory (/docs)
working-directory: arrow-site
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: "pull_request"
on: pull_request

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"


jobs:
ios_watchos:
Expand Down
110 changes: 66 additions & 44 deletions arrow-libs/core/arrow-core/api/arrow-core.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,10 @@ public sealed class Either<out A, out B> {

@Deprecated(
NicheAPI + "Prefer when or fold instead",
ReplaceWith("MN.run { fold({ MN.empty().combine(f(it)) }, { MN.empty().combine(g(it)) }) }")
ReplaceWith("MN.run { fold({ empty().combine(f(it)) }, { empty().combine(g(it)) }) }")
)
public inline fun <C> bifoldMap(MN: Monoid<C>, f: (A) -> C, g: (B) -> C): C =
MN.run { fold({ MN.empty().combine(f(it)) }, { MN.empty().combine(g(it)) }) }
MN.run { fold({ empty().combine(f(it)) }, { empty().combine(g(it)) }) }

/**
* Swap the generic parameters [A] and [B] of this [Either].
Expand Down Expand Up @@ -1083,6 +1083,13 @@ public sealed class Either<out A, out B> {
public inline fun exists(predicate: (B) -> Boolean): Boolean =
fold({ false }, predicate)

@Deprecated(
"Facilitates the migration from Validated to Either.",
ReplaceWith("isRight(predicate)")
)
public inline fun exist(predicate: (B) -> Boolean): Boolean =
exists(predicate)

/**
* Returns `true` if [Left] or returns the result of the application of
* the given predicate to the [Right] value.
Expand Down Expand Up @@ -1138,6 +1145,10 @@ public sealed class Either<out A, out B> {
return getOrElse { null }
}

@Deprecated(
"orNone is being renamed to getOrNone to be more consistent with the Kotlin Standard Library naming",
ReplaceWith("getOrNone()")
)
public fun orNone(): Option<B> = getOrNone()

/**
Expand Down Expand Up @@ -1197,14 +1208,14 @@ public sealed class Either<out A, out B> {
public inline fun <C> traverseNullable(fa: (B) -> C?): Either<A, C>? =
orNull()?.let(fa)?.right()

// TODO will be renamed to mapAccumulating in 2.x.x. Backport, and deprecate in 1.x.x
@Deprecated(
NicheAPI + "Prefer using the Either DSL, or explicit fold or when",
ReplaceWith("fold({ it.left().valid() }, { fa(it).map(::Right) })")
)
@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
public inline fun <AA, C> traverse(fa: (B) -> Validated<AA, C>): Validated<AA, Either<A, C>> =
when (this) {
is Right -> fa(this.value).map(::Right)
is Left -> this.valid()
}
fold({ it.left().valid() }, { fa(it).map(::Right) })

@Deprecated("traverseValidated is being renamed to traverse to simplify the Arrow API", ReplaceWith("traverse(fa)"))
public inline fun <AA, C> traverseValidated(fa: (B) -> Validated<AA, C>): Validated<AA, Either<A, C>> =
Expand Down Expand Up @@ -1333,6 +1344,9 @@ public sealed class Either<out A, out B> {
public fun toValidated(): Validated<A, B> =
fold({ it.invalid() }, { it.valid() })

public fun toIor(): Ior<A, B> =
fold({ Ior.Left(it) }, { Ior.Right(it) })

public companion object {

@Deprecated(
Expand Down Expand Up @@ -1944,6 +1958,13 @@ public sealed class Either<out A, out B> {
)
public fun void(): Either<A, Unit> =
map { }

@Deprecated(
"Facilitates the migration from Validated to Either, you can simply remove this method call.",
ReplaceWith("this")
)
public inline fun toEither(): Either<A, B> =
this
}

/**
Expand Down Expand Up @@ -2596,7 +2617,7 @@ public const val RedundantAPI: String =
public fun <E, A> Either<E, A>.toEitherNel(): EitherNel<E, A> =
mapLeft { nonEmptyListOf(it) }

public fun <E> E.toEitherNel(): EitherNel<E, Nothing> =
public fun <E> E.leftNel(): EitherNel<E, Nothing> =
nonEmptyListOf(this).left()

/**
Expand Down
Loading

0 comments on commit 98192dc

Please sign in to comment.